Re: reassign to builtin possible !?

2008-01-04 Thread Bernhard Merkle
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

Re: reassign to builtin possible !?

2008-01-03 Thread Diez B. Roggisch
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,

reassign to builtin possible !?

2008-01-03 Thread Bernhard Merkle
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

Re: reassign to builtin possible !?

2008-01-03 Thread Bernhard Merkle
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.

Re: reassign to builtin possible !?

2008-01-03 Thread Diez B. Roggisch
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

Re: reassign to builtin possible !?

2008-01-03 Thread Jeroen Ruigrok van der Werven
-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

Re: reassign to builtin possible !?

2008-01-03 Thread Tim Chase
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 =

Re: reassign to builtin possible !?

2008-01-03 Thread Benjamin
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

Re: reassign to builtin possible !?

2008-01-03 Thread Chris Mellon
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