[Python-Dev] [Python-checkins] peps: Update 422 based on python-dev feedback (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Fri Jun 8 03:10:26 CEST 2012
- Previous message: [Python-Dev] [Python-checkins] peps: Update 422 based on python-dev feedback
- Next message: [Python-Dev] [Python-checkins] cpython (3.2): Nudge readers towards a more accurate mental model for loop else clauses
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Jun 8, 2012 at 1:45 AM, Daniel Urban <urban.dani+py at gmail.com> wrote:
On Thu, Jun 7, 2012 at 2:08 PM, nick.coghlan <python-checkins at python.org> wrote:
-* If the metaclass hint refers to an instance of
type
, then it is +* If the metaclass hint refers to a subclass oftype
, then it is considered as a candidate metaclass along with the metaclasses of all of the parents of the class being defined. If a more appropriate metaclass is found amongst the candidates, then it will be used instead of the one I think here "instance" was correct (see http://hg.python.org/cpython/file/default/Lib/types.py#l76 and http://hg.python.org/cpython/file/cedc68440a67/Python/bltinmodule.c#l90).
Hmm, thinking back on it, the REPL experiments that persuaded me Terry was right were flawed (I tried with object directly, but the signature of new/init would have been wrong regardless in that case).
Still, I'm kinda proving my point that I find it difficult to keep all the details of metaclass invocation straight in my head, even though I've been hacking on the type system for years. I've never had anything even close to that kind of problem with class methods :)
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] [Python-checkins] peps: Update 422 based on python-dev feedback
- Next message: [Python-Dev] [Python-checkins] cpython (3.2): Nudge readers towards a more accurate mental model for loop else clauses
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]