Fredrik Lundh wrote: > > mal wrote: > > > time to add a __clone__ slot? > > > > > > or could someone who knows what he's doing here address > > > this comment in copy.py: > > > > > > # XXX need to support copy_reg here too... > > > > All you have to do is implement the copy protocol (ie. .copy()) > > for the type/class in question. > > cannot find any support for that in the copy module (not in 2.0, at least) > > but another reading revealed support for __copy__ and __deepcopy__ > methods in at least 1.5.2 and later. intriguing... You're right... the two methods are named __copy__ and __deepcopy__. Both should return either copies of the object or simply new reference in case the object's are immutable. I've implemented these in mxDateTime and that was all it took to get the copy module happy (at least in Python 1.5.2). -- Marc-Andre Lemburg ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4