On Wed, Apr 20, 2011 at 8:00 AM, Rhodri James
wrote:
> Language abuse: it's not just Python. A donation of just $5 will keep a
> programmer in prepositions for a month. $50 will supply enough articles to
> keep a small company understandable for over a year. With your generous
> help, we can be
On Tue, 19 Apr 2011 17:47:40 +0100, Gerald Britton
wrote:
Gerald Britton wrote:
I now understand the Python does
not consider a class definition as a separate namespace as it does for
function definitions. That is a helpful understanding.
That is not correct. Classes are separate namesp
On 4/19/2011 10:58 AM, Gerald Britton wrote:
serve method unless it is qualified. I now understand the Python does
not consider a class definition as a separate namespace as it does for
function definitions.
Class namespaces are separate namespaces but not in the same way as for
functions. C
On Tue, Apr 19, 2011 at 10:31 AM, Ethan Furman wrote:
> Gerald Britton wrote:
>>
>> I now understand the Python does
>> not consider a class definition as a separate namespace as it does for
>> function definitions. That is a helpful understanding.
>
> That is not correct. Classes are separate n
>Gerald Britton wrote:
>> I now understand the Python does
>> not consider a class definition as a separate namespace as it does for
>> function definitions. That is a helpful understanding.
>That is not correct. Classes are separate namespaces -- they just
>aren't automatically searched. The o
Gerald Britton wrote:
I now understand the Python does
not consider a class definition as a separate namespace as it does for
function definitions. That is a helpful understanding.
That is not correct. Classes are separate namespaces -- they just
aren't automatically searched. The only name
Ethan -- I'm just getting back to this question. If you recall, you asked:
[snip]
8<
"script with possible name clashes"
eggs = 'scrambled eggs'
meat = 'steak'
class Breakfast():
meat = 'spam'
def serve(self):
print("Here's
On Apr 17, 8:56 pm, Chris Rebert wrote:
> On Sun, Apr 17, 2011 at 12:30 PM, Gerald Britton
>
>
>
>
>
>
>
>
>
> wrote:
> > I apologize if this has been answered before or if it is easy to find
> > in the docs. (I couldn't find it but might have missed it)
>
> > I'm trying to understand the differe
Gerald Britton wrote:
For my
final attempt, I add the prefix "a." to my use of "foo"
class a():
... foo = 'foo'
... def g(x):
... return a.foo
...
The first parameter to any method in a class* is going to be the
instance of that class, and is usually named 'self'. So your
Gerald Britton wrote:
However, I would like a deeper
understanding of why I cannot use "foo" as an unqualified variable
inside the method in the class. If Python allowed such a thing, what
problems would that cause?
8<
"script with possible
On Sun, Apr 17, 2011 at 12:30 PM, Gerald Britton
wrote:
> I apologize if this has been answered before or if it is easy to find
> in the docs. (I couldn't find it but might have missed it)
>
> I'm trying to understand the differences between namespaces in class
> definitions vs. function definitio
11 matches
Mail list logo