Re: Equivalent code to the bool() built-in function
- From: Chris Rebert <clp2@xxxxxxxxxxxx>
- Date: Sun, 17 Apr 2011 22:49:41 -0700
On Sun, Apr 17, 2011 at 9:53 PM, Chris Angelico <rosuav@xxxxxxxxx> wrote:
On Mon, Apr 18, 2011 at 2:40 PM, Ned Deily <nad@xxxxxxx> 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
.
- Follow-Ups:
- Re: Equivalent code to the bool() built-in function
- From: Steven D'Aprano
- Re: Equivalent code to the bool() built-in function
- References:
- Equivalent code to the bool() built-in function
- From: candide
- Re: Equivalent code to the bool() built-in function
- From: Chris Rebert
- Re: Equivalent code to the bool() built-in function
- From: Ben Finney
- Equivalent code to the bool() built-in function
- Prev by Date: Re: Equivalent code to the bool() built-in function
- Next by Date: Re: [Q] ipython: Multiple commands on the same line and newlines
- Previous by thread: Re: Equivalent code to the bool() built-in function
- Next by thread: Re: Equivalent code to the bool() built-in function
- Index(es):
Relevant Pages
|