should "self" be changed?

Anssi Saari as at sci.fi
Thu May 28 10:07:11 EDT 2015


Marko Rauhamaa <marko at pacujo.net> writes:

> Ned Batchelder <ned at nedbatchelder.com>:
>
>> I would find it much clearer to not use a nested class at all, and
>> instead to pass the object into the constructor:
>
> Nested classes are excellent and expressing the state pattern <URL:
> http://en.wikipedia.org/wiki/State_pattern>.

Do you have an example of state pattern using nested classes and python?
With a quick look I didn't happen to find one in any language.



More information about the Python-list mailing list