Re: [Python-Dev] [Very Long 23kb] List of Patches to Go in 2.0.1
Guido:
Aahz:
I'm not sure about this, but it seems to me that the attribute change will generate a different .pyc. If I'm wrong about that, this patch as-is is fine with me; otherwise, I'd lobby to use the containment fix but not the attributes (assuming we're willing to use part of a patch).
Adding attributes to xrange() can't possibly change the .pyc files.
Okay, chalk another one up to ignorance. Another thought occurred to me in the shower, though: would this change the pickle of xrange()? If yes, should pickle changes also be prohibited in bugfix releases (in the PEP)? -- --- Aahz <*> (Copyright 2001 by aahz@pobox.com) Androgynous poly kinky vanilla queer het Pythonista http://www.rahul.net/aahz/ Hugs and backrubs -- I break Rule 6 "Boost the stock market -- fire someone"
Adding attributes to xrange() can't possibly change the .pyc files.
Okay, chalk another one up to ignorance. Another thought occurred to me in the shower, though: would this change the pickle of xrange()? If yes, should pickle changes also be prohibited in bugfix releases (in the PEP)?
I agree that pickle changes should be prohibited, although I want to make an exception for the fix to pickling of Unicode objects (which is pretty broken in 2.0). That said, xrange() objects can't be pickled, so it's a non-issue. :-) --Guido van Rossum (home page: http://www.python.org/~guido/)
Okay, chalk another one up to ignorance. Another thought occurred to me in the shower, though: would this change the pickle of xrange()? If yes, should pickle changes also be prohibited in bugfix releases (in the PEP)?
import pickle data = xrange(10) dir(data) ['tolist'] pickle.dumps(data) Traceback (most recent call last): ...
import pickle data = xrange(10) dir(data) ['start', 'step', 'stop', 'tolist'] pickle.dumps(data) Traceback (most recent call last): ...
from the why-dont-you-just-try-it department: Python 2.0 (#8, Jan 29 2001, 22:28:01) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. pickle.PicklingError: can't pickle 'xrange' object: xrange(10) Python 2.1b2 (#12, Mar 22 2001, 15:15:01) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. pickle.PicklingError: can't pickle 'xrange' object: xrange(10) Cheers /F
participants (3)
-
aahz@panix.com -
Fredrik Lundh -
Guido van Rossum