On Jan 3, 8:06 pm, Chris Mellon [EMAIL PROTECTED] wrote:
In Py3k this will be a syntax error, like assigning to None is now.
Possibly also in 2.6.
thanks. I feed much better with that :-)
--
http://mail.python.org/mailman/listinfo/python-list
Bernhard Merkle wrote:
Hi there,
I am reading Learning Python 3e from Mark Lutz and just found out that
reassigning to builtins is possible.
What is the reason, why Python allows this ? IMO this is very risky
and can lead to hard to find errors.
(see also Learning Python 3e, Chapter 16,
Hi there,
I am reading Learning Python 3e from Mark Lutz and just found out that
reassigning to builtins is possible.
What is the reason, why Python allows this ? IMO this is very risky
and can lead to hard to find errors.
(see also Learning Python 3e, Chapter 16, Page 315)
True
True
False
On Jan 3, 2:07 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
This hal always been possible. But it's not reassigning, it's shadowing -
which is a totally different beast. Shadowing builtins is bad style, but
lokal to your context. Which can get nasty of course, if you do the above
on e.g.
Bernhard Merkle wrote:
On Jan 3, 2:07 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
This hal always been possible. But it's not reassigning, it's shadowing -
which is a totally different beast. Shadowing builtins is bad style, but
lokal to your context. Which can get nasty of course, if you
-On [20080103 14:47], Bernhard Merkle ([EMAIL PROTECTED]) wrote:
Are you sure ? what about the following example ?
Is this also shadowing ?
It is, as it is local to your current executing interpreter. Any other Python
process that is currently running is unaffected by your shadowing. So as Diez
But you can't alter the values for True/False globally with this.
Are you sure ? what about the following example ?
Is this also shadowing ?
import __builtin__
__builtin__.True = False
__builtin__.True
False
It doesn't seem to screw things up globally
import __builtin__
t =
On Jan 3, 7:04 am, Bernhard Merkle [EMAIL PROTECTED]
wrote:
Hi there,
I am reading Learning Python 3e from Mark Lutz and just found out that
reassigning to builtins is possible.
What is the reason, why Python allows this ? IMO this is very risky
and can lead to hard to find errors.
I don't
On Jan 3, 2008 8:05 AM, Tim Chase [EMAIL PROTECTED] wrote:
But you can't alter the values for True/False globally with this.
Are you sure ? what about the following example ?
Is this also shadowing ?
import __builtin__
__builtin__.True = False
__builtin__.True
False
It doesn't