Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Anssi Saari Newsgroups: comp.lang.python Subject: Re: should "self" be changed? Date: Thu, 28 May 2015 17:07:11 +0300 Organization: An impatient and LOUD arachnid Lines: 12 Message-ID: References: <551c8229-f426-45f0-a0ee-fdad1b161f59@googlegroups.com> <877frvf7f2.fsf@elektro.pacujo.net> <9f9498a5-8291-4347-aef2-ada324bb47a7@googlegroups.com> <87r3q3dqju.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="afd436d54299ec52d915a4a2551e1d6f"; logging-data="31930"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kkax5QYbWRKXb2q5mmPN2" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:2mNQx9knoWTkfcFLexWhyiwjyq4= sha1:X3YhNp66+d0WYAGRXO/6DL5DnAI= Xref: csiph.com comp.lang.python:91371 Marko Rauhamaa writes: > Ned Batchelder : > >> 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 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.