I have the following script :
class my(): def __init__(self): print('NOP') pass def __new__(cls): print('Init starts') cls.TEST = 'hey' print('Has been Init') m = my m() print(m) print(m, 'hey') print(my.TEST)
Which output the following lines :
(<class main.my at 0x0000000000000031>, ‘hey’)
And then this :
Message: ‘classobj’ object has no attribute ‘TEST’
line 15, in , “C:\Path\To\File.py”
It just looks weird to me thqt the
__new__ function looks like it’s never called.
What could i try ?
Thank you in advance