Re: [Python-Dev] Py2.5 release schedule
Fred L. Drake, Jr. schrieb: > On Sunday 30 July 2006 15:44, Barry Warsaw wrote: > > if isinstance(obj, ClassType) or isinstance(obj, type(type)) > > Looks like you've got a possible name clash in the second isinstance. ;-) Nah, that's rather an entry to the obfuscated Python contest. The two occurrences of type really mean to refer to the same thing; this is the test whether obj _is a_ new-style class. Normally, you would write isinstance(obj, type), but that gives a TypeError in 2.1 (isinstance() arg 2 must be a class or type). In 2.1, type(type) is FunctionType, so the test should fail (in the context, as obj ought to be a string, an exception object, or an exception type). In 2.2 and later, we have >>> type(type) is type 1 # sometimes True instead I think I would have rewritten as try: # Instantiate it if possible and necessary exc = exc() except AttributeError: # no __call__; it's already an object pass (assuming that the mailman exceptions don't have __call__) or as if not isinstance(exc, Exception): exc = exc() (assuming that string exceptions are gone, but the code below already assumes that exc should be an object that supports exc.reason_notice()) Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jul 30, 2006, at 4:27 PM, Fred L. Drake, Jr. wrote: > On Sunday 30 July 2006 16:17, Georg Brandl wrote: >> The second "type" seems to be superfluous. ;) > > I was thinking it suggested there was a local named "type". But if > not, yeah. > > I get the impression Barry's pretty new to this "Python thing." > Wonder what > he's been up to. ;-) As I mentioned, this has to be compatible with Python 2.1: Python 2.1.3+ (#1, Apr 25 2005, 22:52:02) [GCC 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie- on linux2 Type "copyright", "credits" or "license" for more information. >>> isinstance(Exception, type) Traceback (most recent call last): File "", line 1, in ? TypeError: isinstance() arg 2 must be a class or type >>> isinstance(Exception, type(type)) 0 Python 2.5b2 (trunk:50835, Jul 25 2006, 23:27:51) [GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> isinstance(Exception, type) True >>> isinstance(Exception, type(type)) True I thought that was rather clever actually. :) - -Barry -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.3 (Darwin) iQCVAwUBRM0fj3EjvBPtnXfVAQI1AQP+ID6BSbJ/4TL7cizvMjrxHD6JVjFKBzD6 7FCwXpvELQt7vlDWGrXWi+Lai/93nGqD42VYRSgtHqFP2gMYKEkM+TaLl91YFuSh B6jO7l5wW7SGlyLQQiibmPBp8uGDG30F1ylM9e9y9c69Hy1LJEa1sG8/AS/FiA+n fpQ/WlTNRvA= =uGDZ -END PGP SIGNATURE- ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
On Sunday 30 July 2006 16:17, Georg Brandl wrote: > The second "type" seems to be superfluous. ;) I was thinking it suggested there was a local named "type". But if not, yeah. I get the impression Barry's pretty new to this "Python thing." Wonder what he's been up to. ;-) -Fred -- Fred L. Drake, Jr. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
Barry Warsaw wrote: > if isinstance(obj, ClassType) > > which fails in Python 2.5. I actually rewrote it like so: > > if isinstance(obj, ClassType) or isinstance(obj, type(type)) The second "type" seems to be superfluous. ;) Georg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
On Sunday 30 July 2006 15:44, Barry Warsaw wrote: > if isinstance(obj, ClassType) or isinstance(obj, type(type)) Looks like you've got a possible name clash in the second isinstance. ;-) -Fred -- Fred L. Drake, Jr. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Re: Python 2.5 compatibility On Jul 28, 2006, at 8:57 AM, Barry Warsaw wrote: > +1. It would give me more type to port and test a few of my > applications to the new version. > > I'm still working on Mailman but the most painful thing so far has > been the conversion of exceptions to new-style classes, and even > that wasn't /too/ painful. I believe I've finished porting Mailman to Python 2.5. None of the issues were insurmountable, but here they are FTR: 1) Exceptions are new-style classes but Mailman was doing one specific test against the type of an object to see if it needed to be instantiated. This test was written as: if isinstance(obj, ClassType) which fails in Python 2.5. I actually rewrote it like so: if isinstance(obj, ClassType) or isinstance(obj, type(type)) in MM2.1 because it has to be backward compatible to Python 2.1. 2) There was one place where I was commonly raising a string and that generates deprecation warnings, so I changed that to a class. There are a few other legacy string exceptions defined in the code, but they are rarely used and should all get rewritten as well. 3) Cookie.py's repr changed so that trailing semicolons are no longer output on the end of text lines. I understand this change was made so that Python cookies were more RFC compliant, but it broke some homegrown cookie text splitting we were doing. I changed this code to split on lines first. All in all, not too bad although the Cookie.py change took a while to track down! - -Barry -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.3 (Darwin) iQCVAwUBRM0MDnEjvBPtnXfVAQJ9ZAP/VdtM79SXgx7s/X0aEIu4HDZva7TkYyi6 dRzlgAtEV5BN1yYn+vzw8PBCtdy+9N3yYtv/zqdQP54mZDjsaGaNw6MiS0jsETRy 248hj3otL/00WTrKWh8/OvDlLW8KUNQI4MWBOMKJ/TqYW5Es4fJGEMtbO/xqGXXD /wgWmmLOOAE= =Mu8m -END PGP SIGNATURE- ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
Neal Norwitz wrote: > Anthony and I talked about still having b3 on Aug 1. rc1 around Aug > 17-18 (just before the Google sprint which Martin, Jeremy and I will > be attending). Final around 24-29. We didn't discuss with Martin > yet, so these dates are quite tentative. That doesn't work for me. The final release must either happen before Aug 19, or after Sep 9, or somebody else must roll the Windows binaries. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
Neal Norwitz wrote: >Anthony and I talked about still having b3 on Aug 1. rc1 around Aug >17-18 (just before the Google sprint which Martin, Jeremy and I will >be attending). Final around 24-29. We didn't discuss with Martin >yet, so these dates are quite tentative. > > If it doesn't muck-up your workflow, I would like to see all of these dates bumped back by about a week. In particular, it may be too aggressive to expect the __index__ issue be fully resolved by 8/1. Also, I have a few error-traps to add to setobject.c and need to review one of the implementation decisions for str.rpartition(). This weekend, I'll run the head on a few third-party packages to see if their test-suites still pass -- if not, it would be nice to have a bit of time to fix whatever arises. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
On 7/28/06, Michael Hudson <[EMAIL PROTECTED]> wrote: > Anthony Baxter <[EMAIL PROTECTED]> writes: > > > Does anyone disagree with making the next release beta3? > > It seems like a good idea to me. I guess this will mean the final > release will be pushed back a bit? Anthony and I talked about still having b3 on Aug 1. rc1 around Aug 17-18 (just before the Google sprint which Martin, Jeremy and I will be attending). Final around 24-29. We didn't discuss with Martin yet, so these dates are quite tentative. n ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jul 28, 2006, at 1:39 AM, Anthony Baxter wrote: > I've been thinking the same thing, too. A quick chat to Neal says that > he also agrees. > > There's still a lot more bugs popping up than I'm really comfortable > with. I guess this is inevitable - there's a lot of new stuff in 2.5. > > Does anyone disagree with making the next release beta3? +1. It would give me more type to port and test a few of my applications to the new version. FWIW, our commercial app went pretty smoothly, mostly dealing with Py_ssize_t conversions and adopting the new PySet C API. I'm still working on Mailman but the most painful thing so far has been the conversion of exceptions to new-style classes, and even that wasn't / too/ painful. I've only done limited testing of both, but I'm encouraged that the porting effort will be minor (probably no more than a day's worth of work for both apps combined). - -Barry -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.3 (Darwin) iQCVAwUBRMoJonEjvBPtnXfVAQJOjAP9HRbakdb39IOtFxGX/wP4QhiXAcNAbXXM hGFIJ6vC0Gp/SSlTVMYPF5oJMIzuDCIDzs4Nrbgysgfj6Ehyphei/ed8W94PHLat nh54Y0N5pvwLelHW6ChJBcIxulU8Fuj0Z9kIZCLiryTOAyXTh+t3+gZPEzWRY/tY v2hd9ERXDl8= =vK7s -END PGP SIGNATURE- ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
Anthony Baxter <[EMAIL PROTECTED]> writes: > On Friday 28 July 2006 15:32, Raymond Hettinger wrote: >> I suggest that there be a third beta release and that we then wait >> just a bit before going final. >> >> The bugs that were found and fixed in the first two beta releases >> suggest that Py2.5 is not yet as stable as we would like. Over the >> next few days, I'll try to run it on as much third-party code as >> possible. That would have detected the recently surfaced grammar >> error a little bit earlier (the one where "for x, in listOfTuples" >> would not unpack). >> >> The release process itself is going well but I don't think the >> pervasive AST changes have been fully shaken-out yet. > > I've been thinking the same thing, too. A quick chat to Neal says that > he also agrees. > > There's still a lot more bugs popping up than I'm really comfortable > with. I guess this is inevitable - there's a lot of new stuff in 2.5. > > Does anyone disagree with making the next release beta3? It seems like a good idea to me. I guess this will mean the final release will be pushed back a bit? Cheers, mwh -- Gevalia is undrinkable low-octane see-through only slightly roasted bilge water. Compared to .us coffee it is quite drinkable. -- Måns Nilsson, asr ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Py2.5 release schedule
On Friday 28 July 2006 15:32, Raymond Hettinger wrote: > I suggest that there be a third beta release and that we then wait > just a bit before going final. > > The bugs that were found and fixed in the first two beta releases > suggest that Py2.5 is not yet as stable as we would like. Over the > next few days, I'll try to run it on as much third-party code as > possible. That would have detected the recently surfaced grammar > error a little bit earlier (the one where "for x, in listOfTuples" > would not unpack). > > The release process itself is going well but I don't think the > pervasive AST changes have been fully shaken-out yet. I've been thinking the same thing, too. A quick chat to Neal says that he also agrees. There's still a lot more bugs popping up than I'm really comfortable with. I guess this is inevitable - there's a lot of new stuff in 2.5. Does anyone disagree with making the next release beta3? Anthony -- Anthony Baxter <[EMAIL PROTECTED]> It's never too late to have a happy childhood. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com