Re: list comprehension namespace problem

2020-09-24 Thread Frank Millman
On 2020-09-25 7:46 AM, Chris Angelico wrote: On Fri, Sep 25, 2020 at 3:43 PM Frank Millman wrote: Hi all I have a problem related (I think) to list comprehension namespaces. I don't understand it enough to figure out a solution. In the debugger, I want to examine the contents of the current

Re: list comprehension namespace problem

2020-09-24 Thread Chris Angelico
On Fri, Sep 25, 2020 at 3:43 PM Frank Millman wrote: > > Hi all > > I have a problem related (I think) to list comprehension namespaces. I > don't understand it enough to figure out a solution. > > In the debugger, I want to examine the contents of the current instance, > so I can type > >

list comprehension namespace problem

2020-09-24 Thread Frank Millman
Hi all I have a problem related (I think) to list comprehension namespaces. I don't understand it enough to figure out a solution. In the debugger, I want to examine the contents of the current instance, so I can type (Pdb) dir(self) and get the result with no problem. However, it is

Nested inner classes and inheritance - namespace problem

2011-04-13 Thread Larry Hastings
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):

Re: Nested inner classes and inheritance - namespace problem

2011-04-13 Thread James Mills
On Wed, Apr 13, 2011 at 7:12 PM, Larry Hastings la...@hastings.org 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

Re: Nested inner classes and inheritance - namespace problem

2011-04-13 Thread Jean-Michel Pichavant
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): class

Re: Nested inner classes and inheritance - namespace problem

2011-04-13 Thread Eric Snow
On Wed, Apr 13, 2011 at 3:12 AM, Larry Hastings la...@hastings.org 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

Re: Nested inner classes and inheritance - namespace problem

2011-04-13 Thread Larry Hastings
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

Re: Namespace problem?

2010-07-02 Thread Josh English
On Jul 1, 3:30 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: If this is a version of your code that actually fails when you run it   (rather than being another artistic interpretation of a photograph of your   code :-), then I'd go with Matt's analysis.  This will give you a  

Namespace problem?

2010-07-01 Thread Josh English
I have a script that generates a report from a bunch of data I've been collecting for the past year. I ran the script, successfully, for several weeks on test runs and creating more detailed reports. Today (back from vacation) and the script doesn't work. It's giving me a name error. I'm running

Re: Namespace problem?

2010-07-01 Thread Matt McCredie
Josh English joshua.r.english at gmail.com writes: I have a script that generates a report from a bunch of data I've been collecting for the past year. I ran the script, successfully, for several weeks on test runs and creating more detailed reports. Today (back from vacation) and the

Re: Namespace problem?

2010-07-01 Thread Josh English
On Jul 1, 2:50 pm, Matt McCredie mccre...@gmail.com wrote: That doesn't give me enough information to help you with the issue. In general you need to provide enough code to reproduce the failure, not some modified version that doesn't fail. My guess is that the if True is actually something

Re: Namespace problem?

2010-07-01 Thread Mark Lawrence
On 01/07/2010 22:30, Josh English wrote: I have a script that generates a report from a bunch of data I've been collecting for the past year. I ran the script, successfully, for several weeks on test runs and creating more detailed reports. Today (back from vacation) and the script doesn't

Re: Namespace problem?

2010-07-01 Thread Rhodri James
On Thu, 01 Jul 2010 23:07:53 +0100, Josh English joshua.r.engl...@gmail.com wrote: On Jul 1, 2:50 pm, Matt McCredie mccre...@gmail.com wrote: My guess is that the if True is actually something else, and it isn't being interpreted as True. As such, fws_last_col never gets assigned, and

Re: Namespace problem?

2010-07-01 Thread Peter Pearson
On Thu, 01 Jul 2010 23:30:33 +0100, Rhodri James wrote: On Thu, 01 Jul 2010 23:07:53 +0100, Josh English joshua.r.engl...@gmail.com wrote: On Jul 1, 2:50 pm, Matt McCredie mccre...@gmail.com wrote: My guess is that the if True is actually something else, and it isn't being interpreted as