Equivalent code to the bool() built-in function

Chris Rebert clp2 at rebertia.com
Mon Apr 18 07:49:41 CEST 2011


On Sun, Apr 17, 2011 at 9:53 PM, Chris Angelico <rosuav at gmail.com> wrote:
> On Mon, Apr 18, 2011 at 2:40 PM, Ned Deily <nad at acm.org> wrote:
<snip>
>> Even better:
>> $ python2.7 -c 'False = True; print False'
>> True
>
> http://bofh.ch/bofh/bofh13.html
>
>> Alas:
>> $ python3 -c 'False = True; print(False)'
>>  File "<string>", line 1
>> SyntaxError: assignment to keyword
>
> Someone in Python3 dev thinks it's a bad idea to shoot yourself in the foot.
>
> Remind me some day to finish work on my "ultimate programming
> language", which starts out with a clean slate and lets the programmer
> define his own operators and everything.
>
> Pro: The expression evaluator can be taught to interpret Dungeons &
> Dragons notation - 2d6 means "random(1,6)+random(1,6)".
> Con: The same expression might mean something completely different in
> another program.
>
> Pro: You can do anything.
> Con: You can do anything.

I think someone already beat you to it. They call their invention "Lisp". :-P

Cheers,
Chris



More information about the Python-list mailing list