Re: [Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-21 Thread PJ Eby
(Sorry I'm so late to this discussion.) I think that it's important to take into account the fact that PEP 3115 doesn't require namespaces to implement anything more than __setitem__ and __getitem__ (with the latter not even needing to do anything but raise KeyError). Among other things, this

Re: [Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-21 Thread Nick Coghlan
On Sun, Apr 22, 2012 at 12:55 AM, PJ Eby p...@telecommunity.com wrote: (Sorry I'm so late to this discussion.) I think that it's important to take into account the fact that PEP 3115 doesn't require namespaces to implement anything more than __setitem__ and __getitem__ (with the latter not

Re: [Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-21 Thread PJ Eby
On Sat, Apr 21, 2012 at 11:30 AM, Nick Coghlan ncogh...@gmail.com wrote: On Sun, Apr 22, 2012 at 12:55 AM, PJ Eby p...@telecommunity.com wrote: Personally, I think __build_class__ should be explicitly exposed and supported, if for no other reason than that it allows one to re-implement

Re: [Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-16 Thread Daniel Urban
On Mon, Apr 16, 2012 at 04:17, Nick Coghlan ncogh...@gmail.com wrote: Sure, just create a new tracker issue and assign it to me. You already know better than most what the _prepare() step needs to do :) I've created http://bugs.python.org/issue14588, and attached the first version of a patch. I

Re: [Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-15 Thread Daniel Urban
On Tue, Apr 19, 2011 at 16:10, Nick Coghlan ncogh...@gmail.com wrote: In reviewing a fix for the metaclass calculation in __build_class__ [1], I realised that PEP 3115 poses a potential problem for the common practice of using type(name, bases, ns) for dynamic class creation. Specifically, if

Re: [Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-15 Thread Nick Coghlan
/me pages thoughts from 12 months ago back into brain... On Sun, Apr 15, 2012 at 7:36 PM, Daniel Urban urban.dani...@gmail.com wrote: On Tue, Apr 19, 2011 at 16:10, Nick Coghlan ncogh...@gmail.com wrote: Initially I was going to suggest making __build_class__ part of the language definition

Re: [Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-15 Thread Daniel Urban
On Sun, Apr 15, 2012 at 13:48, Nick Coghlan ncogh...@gmail.com wrote: /me pages thoughts from 12 months ago back into brain... Sorry about that, I planned to do this earlier... On Sun, Apr 15, 2012 at 7:36 PM, Daniel Urban urban.dani...@gmail.com wrote: On Tue, Apr 19, 2011 at 16:10, Nick

Re: [Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-15 Thread Nick Coghlan
On Mon, Apr 16, 2012 at 5:34 AM, Daniel Urban urban.dani...@gmail.com wrote: On Sun, Apr 15, 2012 at 13:48, Nick Coghlan ncogh...@gmail.com wrote: /me pages thoughts from 12 months ago back into brain... Sorry about that, I planned to do this earlier... No worries - good to have someone

[Python-Dev] Providing a mechanism for PEP 3115 compliant dynamic class creation

2011-04-19 Thread Nick Coghlan
In reviewing a fix for the metaclass calculation in __build_class__ [1], I realised that PEP 3115 poses a potential problem for the common practice of using type(name, bases, ns) for dynamic class creation. Specifically, if one of the base classes has a metaclass with a significant __prepare__()