Re: about types.new_class and module

2019-03-04 Thread Peter Otten
MRAB wrote: > On 2019-03-04 18:02, Jimmy Girardet wrote: >> Hello, >> >> I'm looking for an explanation where live classes created by >> types.new_class() : >> >> py> import types >> >> py> types.new_class('A') >> >> types.A >> >> py> types.A >> >> AttributeError: module 'types' has no attri

Re: about types.new_class and module

2019-03-04 Thread Jimmy Girardet
Thank you for the clarification. I thought everything was bounded to anything. Shouldn't the name be changed from `types.A` to `unbound.A` to be less confusing ? Le 04/03/2019 à 20:31, MRAB a écrit : 'new_class' creates a new class with the given name and returns a reference to it. The c

Re: about types.new_class and module

2019-03-04 Thread MRAB
On 2019-03-04 18:02, Jimmy Girardet wrote: Hello, I'm looking for an explanation where live classes created by types.new_class() : py> import types py> types.new_class('A') types.A py> types.A AttributeError: module 'types' has no attribute 'A' py> _.__module__ 'types' The new class com

about types.new_class and module

2019-03-04 Thread Jimmy Girardet
Hello, I'm looking for an explanation where live classes created by types.new_class() : py> import types py> types.new_class('A') types.A py> types.A AttributeError: module 'types' has no attribute 'A' py> _.__module__ 'types' The new class comes from `types` module without being inside.