> This is a quite deep problem, actually. I admit I have never used > copy.py because in all cases I needed more control about what should > be copied or not. This generator-copier module that we are talking > about is no exception: its existence is not only due to the fact > that it can copy generators, but also that I needed precise control > over what I copied and what I shared. Putting this information in > __getstate__ or __copy__ methods of instances or in copy_reg only > goes so far, because sometimes you want to do different things with > the same instances in the same program -- e.g. you may want at some > point only a copy of a small number of objects (e.g. to be able to > rollback a small transaction), and at some other point a more > complete copy of the state of the same program. > > Nevertheless, I can surely make a C module that registers in > copy_reg a deep copier for generators. I'm not sure that there would be a general use for this... --Guido van Rossum (home page: http://www.python.org/~guido/)
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