Re: [Python-Dev] Adding test case methods to TestCase subclasses

2011-04-15 Thread Ethan Furman
Ben Finney wrote: Both interesting, thank you. But Python 3 isn't an option for several projects where I'd like to use this. Okay, I took some time to try and figure this out (have I mentioned how much I love Python 3's clean-up?), and I have something -- lightly tested with methods, properti

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Matt Billenstein
On Fri, Apr 15, 2011 at 05:03:55PM -0700, Bob Ippolito wrote: > On Fri, Apr 15, 2011 at 4:12 PM, Antoine Pitrou wrote: > > On Fri, 15 Apr 2011 14:27:04 -0700 > > Bob Ippolito wrote: > >> On Fri, Apr 15, 2011 at 2:20 PM, Antoine Pitrou > >> wrote: > > > > Well, here's a crude microbenchmark. I'm

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Matt Billenstein
On Fri, Apr 15, 2011 at 05:03:55PM -0700, Bob Ippolito wrote: > On Fri, Apr 15, 2011 at 4:12 PM, Antoine Pitrou wrote: > > On Fri, 15 Apr 2011 14:27:04 -0700 > > Bob Ippolito wrote: > >> On Fri, Apr 15, 2011 at 2:20 PM, Antoine Pitrou > >> wrote: > > > > Well, here's a crude microbenchmark. I'm

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Bob Ippolito
On Fri, Apr 15, 2011 at 4:12 PM, Antoine Pitrou wrote: > On Fri, 15 Apr 2011 14:27:04 -0700 > Bob Ippolito wrote: >> On Fri, Apr 15, 2011 at 2:20 PM, Antoine Pitrou wrote: >> > Le vendredi 15 avril 2011 à 14:18 -0700, Bob Ippolito a écrit : >> >> On Friday, April 15, 2011, Antoine Pitrou wrote:

Re: [Python-Dev] python and super

2011-04-15 Thread Greg Ewing
Michael Foord wrote: But you have to be aware that because of the semantics of super, not calling up to your parents basically prevents those methods being used in the presence of multiple inheritance. No, it prevents them being used in the presence of super(). Multiple inheritance is still p

Re: [Python-Dev] python and super

2011-04-15 Thread Greg Ewing
Mark Shannon wrote: class A: pass class B(A): pass class C(A,B):pass Traceback (most recent call last): File "", line 1, in TypeError: Cannot create a consistent method resolution order (MRO) for bases B, A All right, but this is okay: class C(B, A): pass > Michael Foord wrote: > For a

Re: [Python-Dev] python and super

2011-04-15 Thread Greg Ewing
Michael Foord wrote: consider the "recently" introduced problem caused by object.__init__ > not taking arguments. This makes it impossible to use super correctly > in various circumstances. > > ... > It is impossible to inherit from both C and A and have all parent __init__ methods called corr

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Antoine Pitrou
On Fri, 15 Apr 2011 14:27:04 -0700 Bob Ippolito wrote: > On Fri, Apr 15, 2011 at 2:20 PM, Antoine Pitrou wrote: > > Le vendredi 15 avril 2011 à 14:18 -0700, Bob Ippolito a écrit : > >> On Friday, April 15, 2011, Antoine Pitrou wrote: > >> >> > >> >> > Since the JSON spec is set in stone, the cha

Re: [Python-Dev] Adding test case methods to TestCase subclasses

2011-04-15 Thread Ethan Furman
Ethan Furman wrote: Ben Finney wrote: Ethan Furman writes: 8<---test_compose.py--- import unittest ack! There should be an 'import new' here as well. :/ ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Adding test case methods to TestCase subclasses

2011-04-15 Thread Ethan Furman
Ben Finney wrote: Ethan Furman writes: >> Ben Finney wrote: >>> How can composition add test cases detectable by Python's ‘unittest’? >> Metaclasses, if's that an option... […] or a class decorator […] Both interesting, thank you. But Python 3 isn't an option for several projects where I

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Bob Ippolito
On Fri, Apr 15, 2011 at 2:20 PM, Antoine Pitrou wrote: > Le vendredi 15 avril 2011 à 14:18 -0700, Bob Ippolito a écrit : >> On Friday, April 15, 2011, Antoine Pitrou wrote: >> >> >> >> > Since the JSON spec is set in stone, the changes >> >> > will mostly be about API (indentation, object convers

Re: [Python-Dev] Adding test case methods to TestCase subclasses

2011-04-15 Thread Ben Finney
Ethan Furman writes: > Ben Finney wrote: > > TestCase subclasses is a multiple-inheritance use case that I share. > > The mix-ins add test cases (methods named ‘test_’ on the mix-in > > class) to the TestCase subclass. I would prefer not to use multiple > > inheritance for this if it can be achie

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Antoine Pitrou
Le vendredi 15 avril 2011 à 14:18 -0700, Bob Ippolito a écrit : > On Friday, April 15, 2011, Antoine Pitrou wrote: > >> > >> > Since the JSON spec is set in stone, the changes > >> > will mostly be about API (indentation, object conversion, etc) > >> > and optimization. I presume the core parsing

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Bob Ippolito
On Friday, April 15, 2011, Antoine Pitrou wrote: >> >> > Since the JSON spec is set in stone, the changes >> > will mostly be about API (indentation, object conversion, etc) >> > and optimization.  I presume the core parsing logic won't >> > be changing much. >> >> Actually the core parsing logic

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Antoine Pitrou
> > > Since the JSON spec is set in stone, the changes > > will mostly be about API (indentation, object conversion, etc) > > and optimization.  I presume the core parsing logic won't > > be changing much. > > Actually the core parsing logic is very different (and MUCH faster), Are you talking a

Re: [Python-Dev] Adding test case methods to TestCase subclasses

2011-04-15 Thread Ethan Furman
Ben Finney wrote: Ethan Furman writes: Here we have django's TestCase that does *not* want to call unittest2.TestCase (assuming that's not a bug), but it gets called anyway because the Mixin3 sibling has it as a base class. So does this mean that TestCase and Mixin3 just don't play well toget

Re: [Python-Dev] python and super

2011-04-15 Thread Nick Coghlan
On Fri, Apr 15, 2011 at 11:30 PM, Michael Foord wrote: > On 15/04/2011 02:02, Greg Ewing wrote: >> There isn't necessarily a clear distinction between parents >> and siblings. >> >> class A: >>  ... >> >> class B(A): >>  ... >> >> class C(A, B): >>  ... >> >> In C, is A a parent of B or a sibling

Re: [Python-Dev] Adding test case methods to TestCase subclasses

2011-04-15 Thread Éric Araujo
Hi, I just wanted to clear a slight misunderstanding: How can composition add test cases detectable by Python 2's ‘unittest’ and Python 3's ‘unittest2’? The package shipped in the stdlib is named unittest in all Python versions. The codebase that has seen a lot of improvements thanks to Mic

Re: [Python-Dev] Test cases not garbage collected after run

2011-04-15 Thread Martin (gzlist)
On 14/04/2011, Michael Foord wrote: > I'd be interested to know what is keeping the tests alive even when the > test suite isn't. As far as I know there is nothing else in unittest > that would do that. The main cause is some handy code for collecting and filtering tests by name, which unintentio

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-15 Thread Bob Ippolito
On Thu, Apr 14, 2011 at 2:29 PM, Raymond Hettinger wrote: > > On Apr 14, 2011, at 12:22 PM, Sandro Tosi wrote: > >> The version we have in cpython of json is simplejson 2.0.9 highly >> patched (either because it was converted to py3k, and because of the >> normal flow of issues/bugfixes) while ups

[Python-Dev] Summary of Python tracker Issues

2011-04-15 Thread Python tracker
ACTIVITY SUMMARY (2011-04-08 - 2011-04-15) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open2734 ( -7) closed 20899 (+54) total 23633 (+47) Open issues wit

Re: [Python-Dev] python and super

2011-04-15 Thread Michael Foord
On 15/04/2011 16:18, Carl Meyer wrote: On 04/15/2011 08:53 AM, Michael Foord wrote: If we treat django's failure to use super as a bug, you want the Python language to work-around that bug so that: What you say (that this particular circumstance could be treated as a bug in django) is true, J

Re: [Python-Dev] python and super

2011-04-15 Thread Carl Meyer
On 04/15/2011 08:53 AM, Michael Foord wrote: >> If we treat django's failure to use super as a bug, you want the >> Python language to work-around that bug so that: > > What you say (that this particular circumstance could be treated as a > bug in django) is true, Just as a side note: if there

Re: [Python-Dev] python and super

2011-04-15 Thread Mark Shannon
Michael Foord wrote: On 15/04/2011 02:02, Greg Ewing wrote: Michael Foord wrote: What I was suggesting is that a method not calling super shouldn't stop a *sibling* method being called, but could still prevent the *parent* method being called. There isn't necessarily a clear distinction betwe

Re: [Python-Dev] Releases for recent security vulnerability

2011-04-15 Thread Jesse Noller
On Fri, Apr 15, 2011 at 8:59 AM, Antoine Pitrou wrote: > On Fri, 15 Apr 2011 08:36:16 -0400 > Jesse Noller wrote: >> On Fri, Apr 15, 2011 at 8:30 AM, Brian Curtin wrote: >> > >> > On Apr 15, 2011 3:46 AM, "Gustavo Narea" wrote: >> >> >> >> Hi all, >> >> >> >> How come a description of how to ex

Re: [Python-Dev] http://docs.python.org/py3k/ pointing to 2.7

2011-04-15 Thread Victor Stinner
Le vendredi 15 avril 2011 à 13:34 +0200, Jesus Cea a écrit : > http://docs.python.org/py3k/ takes you to 2.7, by default. > > Should we update it to point to 3.2?. If the point is to promote Python 3... > > I would point it to 3.2, with a big "access to documentation to legacy > 2.7" (beside the

Re: [Python-Dev] Releases for recent security vulnerability

2011-04-15 Thread Fred Drake
On Fri, Apr 15, 2011 at 8:59 AM, Antoine Pitrou wrote: > Relying on a vendor distribution (such as a Linux distro, or > ActiveState) is hopefully enough to get these security updates in time > without patching anything by hand. I don't think many people compile > Python for production use, but man

Re: [Python-Dev] python and super

2011-04-15 Thread Michael Foord
On 15/04/2011 02:23, Steven D'Aprano wrote: Ricardo Kirkner wrote: I have a TestCase class, which inherits from both Django's TestCase and from some custom TestCases that act as mixin classes. So I have something like class MyTestCase(TestCase, Mixin1, Mixin2): ... now django's TestCase cl

Re: [Python-Dev] python and super

2011-04-15 Thread Michael Foord
On 15/04/2011 02:02, Greg Ewing wrote: Michael Foord wrote: What I was suggesting is that a method not calling super shouldn't stop a *sibling* method being called, but could still prevent the *parent* method being called. There isn't necessarily a clear distinction between parents and siblin

Re: [Python-Dev] Releases for recent security vulnerability

2011-04-15 Thread Antoine Pitrou
On Fri, 15 Apr 2011 08:36:16 -0400 Jesse Noller wrote: > On Fri, Apr 15, 2011 at 8:30 AM, Brian Curtin wrote: > > > > On Apr 15, 2011 3:46 AM, "Gustavo Narea" wrote: > >> > >> Hi all, > >> > >> How come a description of how to exploit a security vulnerability > >> comes before a release for said

Re: [Python-Dev] Releases for recent security vulnerability

2011-04-15 Thread Jesse Noller
On Fri, Apr 15, 2011 at 8:30 AM, Brian Curtin wrote: > > On Apr 15, 2011 3:46 AM, "Gustavo Narea" wrote: >> >> Hi all, >> >> How come a description of how to exploit a security vulnerability >> comes before a release for said vulnerability? I'm talking about this: >> http://blog.python.org/2011/0

Re: [Python-Dev] Releases for recent security vulnerability

2011-04-15 Thread Brian Curtin
On Apr 15, 2011 3:46 AM, "Gustavo Narea" wrote: > > Hi all, > > How come a description of how to exploit a security vulnerability > comes before a release for said vulnerability? I'm talking about this: > http://blog.python.org/2011/04/urllib-security-vulnerability-fixed.html > > My understanding

Re: [Python-Dev] http://docs.python.org/py3k/ pointing to 2.7

2011-04-15 Thread Antoine Pitrou
On Fri, 15 Apr 2011 13:34:59 +0200 Jesus Cea wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > http://docs.python.org/py3k/ takes you to 2.7, by default. Really? Perhaps it has already been fixed, but I read “Python v3.2 documentation” on that page. Antoine. ___

[Python-Dev] http://docs.python.org/py3k/ pointing to 2.7

2011-04-15 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 http://docs.python.org/py3k/ takes you to 2.7, by default. Should we update it to point to 3.2?. If the point is to promote Python 3... I would point it to 3.2, with a big "access to documentation to legacy 2.7" (beside the small left column link). W

Re: [Python-Dev] python and super

2011-04-15 Thread Greg Ewing
R. David Murray wrote: Why not? It seems more useful than using it for chaining, especially given the compiler hack in Python3. Because it's prone to doing the wrong thing if the class using it is ever involved in multiple inheritance. If you're expecting the call to go to a particular class,

Re: [Python-Dev] Releases for recent security vulnerability

2011-04-15 Thread Senthil Kumaran
On Fri, Apr 15, 2011 at 09:35:06AM +0100, Gustavo Narea wrote: > > How come a description of how to exploit a security vulnerability > comes before a release for said vulnerability? I'm talking about this: > http://blog.python.org/2011/04/urllib-security-vulnerability-fixed.html > > My understand

[Python-Dev] Releases for recent security vulnerability

2011-04-15 Thread Gustavo Narea
Hi all, How come a description of how to exploit a security vulnerability comes before a release for said vulnerability? I'm talking about this: http://blog.python.org/2011/04/urllib-security-vulnerability-fixed.html My understanding is that the whole point of asking people not to report security