Re: [Python-ideas] Make functions, methods and descriptor types living in the types module

2018-01-12 Thread Guido van Rossum
On Thu, Jan 11, 2018 at 8:45 PM, Steve Dower wrote: > I certainly have code that joins __module__ with __name__ to create a > fully-qualified name (with special handling for those builtins that are not > in builtins), and IIUC __qualname__ doesn't normally include the

Re: [Python-ideas] Make functions, methods and descriptor types living in the types module

2018-01-12 Thread Random832
On Thu, Jan 11, 2018, at 17:41, Victor Stinner wrote: > I like the idea of having a fully qualified name that "works" (can be > resolved). > > I don't think that repr() should change, right? What if we made these types available under their current name in the types module? e.g. types.module,

Re: [Python-ideas] Make functions, methods and descriptor types living in the types module

2018-01-11 Thread Steve Dower
I certainly have code that joins __module__ with __name__ to create a fully-qualified name (with special handling for those builtins that are not in builtins), and IIUC __qualname__ doesn't normally include the module name either (it's intended for nested types/functions). Can we make it

Re: [Python-ideas] Make functions, methods and descriptor types living in the types module

2018-01-11 Thread Victor Stinner
I like the idea of having a fully qualified name that "works" (can be resolved). I don't think that repr() should change, right? Can this change break the backward compatibility somehow? Victor Le 11 janv. 2018 21:00, "Serhiy Storchaka" a écrit : > Currently the classes

[Python-ideas] Make functions, methods and descriptor types living in the types module

2018-01-11 Thread Serhiy Storchaka
Currently the classes of functions (implemented in Python and builtin), methods, and different type of descriptors, generators, etc have the __module__ attribute equal to "builtins" and the name that can't be used for accessing the class. >>> def f(): pass ... >>> type(f) >>>