On Thu, Jun 12, 2008 at 8:06 PM, Frank Wierzbicki <[EMAIL PROTECTED]> wrote:
>
> On Wed, Jun 11, 2008 at 5:27 PM, Curt Hagenlocher <[EMAIL PROTECTED]> wrote:
> > If I recall correctly, Jython handles this by appending a trailing
> > underscore to the imported name and there's no reason why we could
On Wed, Jun 11, 2008 at 5:27 PM, Curt Hagenlocher <[EMAIL PROTECTED]> wrote:
> If I recall correctly, Jython handles this by appending a trailing
> underscore to the imported name and there's no reason why we couldn't
> do something similar.
In truth the current implementation of Jython allows keyw
On Thu, Jun 12, 2008 at 10:28 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> That makes about as much sense as wanting to support a.42 = b since
> a[42] = b works. :-)
Well don't I feel silly now.
--
Cheers,
Leif
___
Python-Dev mailing list
Python-D
On Thu, Jun 12, 2008 at 10:13 AM, Leif Walsh <[EMAIL PROTECTED]> wrote:
> I haven't been following this thread very closely, so I'm not sure
> what the status is, but I'd just like to point out that yesterday I
> used the fact that a[None] = b works, when I used the @memoize
> decorator from the wi
I haven't been following this thread very closely, so I'm not sure
what the status is, but I'd just like to point out that yesterday I
used the fact that a[None] = b works, when I used the @memoize
decorator from the wiki. This seems to provide an argument that, for
symmetry's sake, we might want
Curt Hagenlocher wrote:
If I recall correctly, Jython handles this by appending a trailing
underscore to the imported name and there's no reason why we couldn't
do something similar.
It also has the virtue of being the common convention for attribute
names that shadow keywords even in CPython
On Sun, Jun 8, 2008 at 10:19 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
>
> > So, it's okay to setattr the attribute name "None" but not okay to set
> > it directly? Is this deliberate or is it an unintentional side effect
> > of parser changes to prevent assignment to None?
>
> It's deliber
Thomas Lee wrote:
Martin v. Löwis wrote:
In Python 3, None, True, and False are keywords, so clearly, the
intended semantics is also the implemented one (and the language
description for 2.x needs to be updated/clarified).
Interestingly enough, the semantics of True, False and None are
diff
Thomas Lee schrieb:
What happened in 3k? Were the constants in xmlrpclib renamed/removed?
They were removed, as there is no way they can be accessed as attributes of a
module now.
Georg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.
Martin v. Löwis wrote:
The question is, what is the specification for Python.
Now, that's a more interesting question than the question originally
asked (which I interpreted as "why does it work the way it works").
The only indication in the specification of that feature I could find
was:
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
|> At the global level, the subversion does not work:
|
| I think you are misinterpreting what you are seeing.
No, you didn't understand the code I posted which explicitely demonstrated
the same point you repeated.
> The question is, what is the specification for Python.
Now, that's a more interesting question than the question originally
asked (which I interpreted as "why does it work the way it works").
The only indication in the specification of that feature I could find
was:
http://docs.python.org/dev/
> At the global level, the subversion does not work:
I think you are misinterpreting what you are seeing. When you refer to
the global identifier None, the compiler just knows that it must be
the NoneType singleton, and returns it as a constant, without doing any
name lookup. So it isn't that assi
"Tony Nelson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| At 4:46 PM +0100 6/9/08, Michael Foord wrote:
| Or perhaps CPython should just stop trying to detect this at compile
time.
| Note that while assignment to ".None" is not allowed, setattr(foo,
"None",
| 1) then referenci
On Jun 9, 2008, at 17:12, Alex Martelli wrote:
The problem is more general: what if a member (of some external
object we're proxying one way or another) is named print (in Python <
3), or class, or...? To allow foo.print or bar.class would require
pretty big changes to Python's parser
I simp
Tony Nelson wrote:
At 4:46 PM +0100 6/9/08, Michael Foord wrote:
Alex Martelli wrote:
The problem is more general: what if a member (of some external
object we're proxying one way or another) is named print (in Python <
3), or class, or...? To allow foo.print or bar.class would requir
At 4:46 PM +0100 6/9/08, Michael Foord wrote:
>Alex Martelli wrote:
>> The problem is more general: what if a member (of some external
>> object we're proxying one way or another) is named print (in Python <
>> 3), or class, or...? To allow foo.print or bar.class would require
>> pretty big chang
Alex Martelli wrote:
The problem is more general: what if a member (of some external
object we're proxying one way or another) is named print (in Python <
3), or class, or...? To allow foo.print or bar.class would require
pretty big changes to Python's parser -- I have vague memories that
the i
The problem is more general: what if a member (of some external
object we're proxying one way or another) is named print (in Python <
3), or class, or...? To allow foo.print or bar.class would require
pretty big changes to Python's parser -- I have vague memories that
the issue was discussed ages
Steven D'Aprano wrote:
On Mon, 9 Jun 2008 12:24:55 pm Curt Hagenlocher wrote:
So, it's okay to setattr the attribute name "None" but not okay to
set it directly?
I suspect this is off-topic for python-dev, and would be better on
comp.lang.python or similar, but for what it's worth,
> So, it's okay to setattr the attribute name "None" but not okay to set
> it directly? Is this deliberate or is it an unintentional side effect
> of parser changes to prevent assignment to None?
It's deliberate. setattr(o, "foo bar", "baz") also works, even though
"foo bar" is not an identifier.
On Mon, 9 Jun 2008 12:24:55 pm Curt Hagenlocher wrote:
> So, it's okay to setattr the attribute name "None" but not okay to
> set it directly?
I suspect this is off-topic for python-dev, and would be better on
comp.lang.python or similar, but for what it's worth, I consider having
an attribu
On Sun, Jun 8, 2008 at 9:24 PM, Curt Hagenlocher <[EMAIL PROTECTED]> wrote:
> My apologies if this is one of those "dead horse" issues. The
> following seems a little inconsistent to me:
>
c = C()
c.None
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: C ins
My apologies if this is one of those "dead horse" issues. The
following seems a little inconsistent to me:
>>> c = C()
>>> c.None
Traceback (most recent call last):
File "", line 1, in
AttributeError: C instance has no attribute 'None'
>>> c.None = 'foo'
File "", line 1
SyntaxError: assignme
24 matches
Mail list logo