This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author carsten.klein@axn-software.de
Recipients Arfrever, Mark.Shannon, alex, barry, benjamin.peterson, carsten.klein@axn-software.de, cvrebert, daniel.urban, eric.snow, meador.inge, michael.foord, ncoghlan, python-dev
Date 2012-10-02.20:07:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349208440.26.0.911988493321.issue12370@psf.upfronthosting.co.za>
In-reply-to
Content
The change was introduced in r30 (Python/symtable.c @ near where it reads /* Special-case super: it counts as a use of __class__ */)
which now enforces that a class that calls super on init will have the correct class information present.

I do not think that this is a bug and that it should be fixed.
Instead it enforces both type safety in respect to classes deriving from a given class hierarchy being forced to report their actual class instead of some fabricated and customly induced one.

If you require such behaviour then you should implement your own meta class that will then override the __class__ property.

And, yes, I do think that Python < 3.0 was wrong in the assumption that one could build up class hierarchies and then break out of that class hierarchy by simply providing a __class__ property that would return a different value as what one would expected.

What do the others think?
History
Date User Action Args
2012-10-02 20:07:20carsten.klein@axn-software.desetrecipients: + carsten.klein@axn-software.de, barry, ncoghlan, benjamin.peterson, Arfrever, alex, michael.foord, cvrebert, meador.inge, daniel.urban, Mark.Shannon, python-dev, eric.snow
2012-10-02 20:07:20carsten.klein@axn-software.desetmessageid: <1349208440.26.0.911988493321.issue12370@psf.upfronthosting.co.za>
2012-10-02 20:07:20carsten.klein@axn-software.delinkissue12370 messages
2012-10-02 20:07:19carsten.klein@axn-software.decreate