Author levkivskyi
Recipients gvanrossum, levkivskyi, serhiy.storchaka
Date 2017-12-12.12:23:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513081400.52.0.213398074469.issue32226@psf.upfronthosting.co.za>
In-reply-to
Content
> As for __class_getitem__, why not implement type.__getitem__ instead of hacking PyObject_GetItem()?

This question was raised by Mark Shannon on python-dev. Actually, my initial implementation did exactly this, but I didn't like it for two reasons:

1. dir(type) is already very long, I don't want to make it even longer.
2. Some users may be surprised that although ``type.__getitem__`` is defined, ``int[something]`` will rise "TypeError: type object is not subscriptable"

Mark however disappeared since then, so I don't know what is his current opinion. I am however not as sure about this now. If there are some arguments for this, then I can revert to the older approach (implementing ``type.__getitem__``).
History
Date User Action Args
2017-12-12 12:23:20levkivskyisetrecipients: + levkivskyi, gvanrossum, serhiy.storchaka
2017-12-12 12:23:20levkivskyisetmessageid: <1513081400.52.0.213398074469.issue32226@psf.upfronthosting.co.za>
2017-12-12 12:23:20levkivskyilinkissue32226 messages
2017-12-12 12:23:20levkivskyicreate