On 04/13/2011 07:37 PM, Eric Snow wrote:
I suppose you could try something like this:
class Outer:
global Inner
class Inner:
class Worker:
pass
class InnerSubclass(Inner):
class Worker(Inner.Worker):
pass
However, that pollutes your global namespace. If you are worr
On Wed, Apr 13, 2011 at 3:12 AM, Larry Hastings wrote:
>
> The problem: if you're currently in a nested class, you can't look up
> variables in the outer "class scope".
>
> For example, this code fails in Python 3:
>
> class Outer:
> class Inner:
> class Worker:
> pass
>
> class Inn
Larry Hastings wrote:
The problem: if you're currently in a nested class, you can't look up
variables in the outer "class scope".
For example, this code fails in Python 3:
class Outer:
class Inner:
class Worker:
pass
class InnerSubclass(Inner):
clas
On Wed, Apr 13, 2011 at 7:12 PM, Larry Hastings wrote:
> Yes, I could make the problem go away if I didn't have nested inner classes
> like this. But I like this structure. Any idea how I can make it work
> while preserving the nesting and inheritance?
It's probably better to make use of module
The problem: if you're currently in a nested class, you can't look up
variables in the outer "class scope".
For example, this code fails in Python 3:
class Outer:
class Inner:
class Worker:
pass
class InnerSubclass(Inner):
class Worker(Inner.Worker):