When is an int not an int? Who can explain this?

Random832 random832 at fastmail.com
Mon Jan 18 12:02:30 EST 2016


On Mon, Jan 18, 2016, at 11:51, Chris Angelico wrote:
> Armed with that information, you should be able to track down what's
> going on. It's curious, though, that you have a callable subclass of
> module bound to the name int. Very curious indeed.

He hasn't tried calling it. And there's no reason to assume it is a
subclass. The results he's shown imply that the object bound to the name
int is an instance of a type named module* (which is almost certainly,
but not definitely, the usual module type itself, and no more likely to
be a subclass of it than of anything else.)

*Strictly speaking, a type whose repr is "<class 'module'>"



More information about the Python-list mailing list