>>> class A: ... pass ... >>> def func(): ... a = A() ... print(a) ... >>> func() <__main__.A object at 0x7f8e9a4da430>
(Dec-15-2021, 08:26 AM)Gribouillis Wrote: I'm not sure if this is what you mean, but yes it is possible >>> class A: ... pass ... >>> def func(): ... a = A() ... print(a) ... >>> func() <__main__.A object at 0x7f8e9a4da430>
jc4d Wrote:I noticed you have a pass statement at the end of the class, is that necessary?
>>> class A: ... """This class does nothing""" ... >>>
(Dec-15-2021, 10:51 AM)Gribouillis Wrote: No it is not necessary. I wrote the 'pass' in order to give a non empty body to the class definition.