[Python-Dev] Submitting PEP 422 (Simple class initialization hook) for pronouncement (original) (raw)
Guido van Rossum guido at python.org
Mon Feb 11 18:44:46 CET 2013
- Previous message: [Python-Dev] Submitting PEP 422 (Simple class initialization hook) for pronouncement
- Next message: [Python-Dev] Submitting PEP 422 (Simple class initialization hook) for pronouncement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Nick,
I think this will make a fine addition to the language. I agree that it is superior to the alternatives and fulfills a real (if rare) need.
I only have a few nits/questions/suggestions.
With PJE, I think init_class should automatically be a class method. The same way that new is automatically a class method.
Would it make any sense to require that init_class returns the new class object (to complete the similarity with class decorators)?
Frankly, I lost track of things when you were discussing the exact point in time where class is added to the class. (This may place me outside the set of people who fully understand Python's metaclasses. So be it. :-) Perhaps some explanation of the existing mechanism would be in place? It would be nice if you explained reason for why class cannot be set earlier in the game (otherwise the response to this argument would be "so fix it", but somehow I doubt that is possible). I think it may also be unclear at all times whether class, when referenced, is meant to refer to the metaclass or to the class under construction.
I wouldn't add the OrderedMeta/OrderedClass to the PEP. Keep it focused on enabling.
Adding more examples would be great.
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] Submitting PEP 422 (Simple class initialization hook) for pronouncement
- Next message: [Python-Dev] Submitting PEP 422 (Simple class initialization hook) for pronouncement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]