How to extend inner classes?

K

Kay Schluehr

You can define a class variable Pos with the class Pos as its value

class PeriodicGrid :
class Pos:
pass
Pos = Pos
<__main__.Pos instance at 0x00EEFAD0>

Ciao
Kay
 
A

Alex Martelli

Kay Schluehr said:
You can define a class variable Pos with the class Pos as its value

class PeriodicGrid :
class Pos:
pass
Pos = Pos

<__main__.Pos instance at 0x00EEFAD0>

You can, but that 'Pos = Pos' statement in this code is just as
redundant and useless as it appears. In every aspect, the behavior will
be exactly identical if you remove that assignment.


Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,087
Members
48,773
Latest member
Kaybee

Latest Threads

Top