471,350 Members | 1,450 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

copy.deepcopy() doesn't (for class objects): any thoughts?

bartonc
6,596 Expert 4TB
I was playing around with the Simple Metaclassing thread and found something odd:
Expand|Select|Wrap|Line Numbers
  1. >>> class aClass:
  2. ...     classVar1 = 'hello'
  3. ...     def __init__(self, arg1):
  4. ...         self.instVar1 = arg1
  5. ...         
  6. >>> anInstance = aClass('world')
  7. >>> import copy
  8. >>> bClass = copy.deepcopy(anInstance.__class__)
  9. >>> bClass
  10. <class __builtin__.aClass at 0x02FA7240>
  11. >>> aClass
  12. <class __builtin__.aClass at 0x02FA7240>
  13. >>> bClass = copy.deepcopy(aClass)
  14. >>> bClass
  15. <class __builtin__.aClass at 0x02FA7240>
Aug 25 '07 #1
0 1030

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Nick Jacobson | last post: by
6 posts views Thread by Alexander Zatvornitskiy | last post: by
42 posts views Thread by Edward Diener | last post: by
reply views Thread by Joshua Ginsberg | last post: by
4 posts views Thread by KraftDiner | last post: by
reply views Thread by Russell Blau | last post: by
3 posts views Thread by yoma | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.