You can call a public static property on an instance of a class in Python using the class name followed by the property name. Here's an example:
main.py143 chars7 lines
In this example, foo
is a public static property of MyClass
. To access foo
on an instance of MyClass
, you can use either the class name (MyClass.foo
) or the instance (my_obj.foo
). Both ways will give you the same result: 42.
gistlibby LogSnag