Re: Overriding True and False ?

2017-01-31 Thread jladasky
On Sunday, January 29, 2017 at 11:29:29 PM UTC-8, Irv Kalb wrote: > It seems very odd that Python allows you to override the values of > True and False. Hi Irv, Let me join the chorus of people who are encouraging you to switch to Python3, which corrects this problem. Overriding builtins has

Re: Overriding True and False ?

2017-01-30 Thread Christian Gollwitzer
Am 31.01.17 um 04:27 schrieb Ian Kelly: On Jan 30, 2017 6:07 PM, "Steve D'Aprano" wrote: Hey Ian, Your news reader or mail client has stopped quoting the text you are quoting, so it appears as if you have written it. See:

Re: Overriding True and False ?

2017-01-30 Thread Ben Finney
Ian Kelly writes: > Well, nuts. It looks fine in my client (the Gmail Android app) so I > guess this must be an issue of HTML versus text content. Unfortunately > the mobile client doesn't have any option for text-only that I can > find, so my options appear to be to

Re: Overriding True and False ?

2017-01-30 Thread Ian Kelly
On Jan 30, 2017 6:07 PM, "Steve D'Aprano" wrote: > Hey Ian, > > Your news reader or mail client has stopped quoting the text you are > quoting, so it appears as if you have written it. > > See: > > https://mail.python.org/pipermail/python-list/2017-January/719015.html

Re: Overriding True and False ?

2017-01-30 Thread Steve D'Aprano
On Tue, 31 Jan 2017 03:12 am, Ian Kelly wrote: > On Jan 30, 2017 1:32 AM, "Irv Kalb" wrote: > > I teach intro to programming using Python. In my first assignment, > students are asked to assign variables of different types and print out > the values. [...] Hey Ian, Your

Re: Overriding True and False ?

2017-01-30 Thread Ian Kelly
On Jan 30, 2017 1:32 AM, "Irv Kalb" wrote: I teach intro to programming using Python. In my first assignment, students are asked to assign variables of different types and print out the values. One student (who really did not understand Booleans) turned in the following

Re: Overriding True and False ?

2017-01-30 Thread Ian Kelly
On Jan 30, 2017 2:00 AM, "Chris Angelico" wrote: (Interestingly, Ellipsis is not included in that.) Perhaps because it's rather unusual for a program to depend upon the value of Ellipsis. -- https://mail.python.org/mailman/listinfo/python-list

Re: Overriding True and False ?

2017-01-30 Thread Chris Angelico
On Mon, Jan 30, 2017 at 4:03 PM, Irv Kalb wrote: > It seems very odd that Python allows you to override the values of True and > False. In the code, True and False were clearly recognized as keywords as > they were colored purple. But there was no error message. > > You

Re: Overriding True and False ?

2017-01-30 Thread Chris Angelico
On Mon, Jan 30, 2017 at 6:50 PM, Deborah Swanson wrote: > Looks like the moral of the story is that in Python 2.7 you can redefine > keywords, so long as you don't get any syntax errors after (or during) > redefinition. The moral is actually that "True" and "False"

Re: Overriding True and False ?

2017-01-29 Thread Ben Finney
Irv Kalb writes: > I teach intro to programming using Python. […] Thank you for teaching Python to beginners! > It seems very odd that Python allows you to override the values of > True and False. Yes, it is. That's why Python 3 forbids it:: >>> True = "shadow"

RE: Overriding True and False ?

2017-01-29 Thread Deborah Swanson
Irv Kalb wrote, on Sunday, January 29, 2017 9:04 PM > > I teach intro to programming using Python. In my first > assignment, students are asked to assign variables of > different types and print out the values. > > One student (who really did not understand Booleans) turned > in the

Re: Overriding True and False ?

2017-01-29 Thread INADA Naoki
It's fixed already in Python 3. Please use Python 3 when teaching to students. $ python3 Python 3.6.0 (default, Dec 24 2016, 00:01:50) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> True = "foo"