top of page
Search

PYTHON CODING

  • Writer: waclaw_koscielniak
    waclaw_koscielniak
  • Aug 28
  • 1 min read

class Meta(type):

def __new__(cls, name, bases, dct):

dct["id"] = 99

return super().__new__(cls, name, bases, dct)

class A(metaclass=Meta):

pass

print(A.id)


[Running] python3 -u "/Users/name/test/test74.py"

99

[Done] exited with code=0 in 0.057 seconds


Try to run it.
Try to run it.

 
 
 

1 Comment


Guest
Aug 28

Did you try to run it?

Like
bottom of page