Type constants in type module

D

Dave Harris

If
splunge = 3
forMeToo = splunge.__add__

type(forMeToo) prints:

<type 'method-wrapper'>

The constants defined in the types.py module do not include this type. Is this an oversight or am I looking at a detail which is supposed to be hidden from view?

Thanks,
Dave Harris
Engineering Data Consultants
 
T

Terry Reedy

If
splunge = 3
forMeToo = splunge.__add__

type(forMeToo) prints:

<type 'method-wrapper'>

The constants defined in the types.py module do not include this type.
Is this an oversight or am I looking at a detail which is supposed to
be hidden from view?
-----------------
type(3.__add__) should give you same puzzle.

Yes, method wrapper is a current implementation detail which is not
part of language per se. But it is obviously not hidden ;-).

Terry J. Reedy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top