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 veky
Recipients eric.araujo, eric.snow, ezio.melotti, gvanrossum, martin.panter, ncoghlan, pitrou, rbcollins, serhiy.storchaka, veky, vstinner
Date 2017-09-19.08:42:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505810568.52.0.0226470508799.issue13224@psf.upfronthosting.co.za>
In-reply-to
Content
getname sounds good, but is in fact very confusing. In most cases, what you'd actually want, and end up writing, is getname(type(x)), but we can't make it the default since for classes we would actually like x.__name__ directly. It seems you say the same with "get the names of various things (e.g. via `__class__`)", but the interface is very complicated if we try to guess what people meant, and clumsy if we force people to write type almost all the time.

The point is, we want to be explicit about whether we are speaking about x or type(x). Everything else is simply presentation details. type does it perfectly well, only the presentation details are canonically handled via str and repr. And it's perfectly natural, BTW. Imagine if str(5) gave you '<integer 5>'. :-o
History
Date User Action Args
2017-09-19 08:42:48vekysetrecipients: + veky, gvanrossum, ncoghlan, pitrou, vstinner, rbcollins, ezio.melotti, eric.araujo, eric.snow, martin.panter, serhiy.storchaka
2017-09-19 08:42:48vekysetmessageid: <1505810568.52.0.0226470508799.issue13224@psf.upfronthosting.co.za>
2017-09-19 08:42:48vekylinkissue13224 messages
2017-09-19 08:42:48vekycreate