On Oct 16, 12:05 am, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
On Sat, 15 Oct 2011 15:04:24 -0700, DevPlayer wrote:
I thought x not in y was later added as syntax sugar for not x in y
meaning they used the same set of tokens. (Too lazy to check the actual
tokens)
Stated
On 10.10.2011 19:29, Nobody wrote:
On Sun, 09 Oct 2011 02:25:27 +0200, Alexander Kapps wrote:
Even if it's off-topic, could you add some similar explanations for
Church numerals (maybe Lambda calculus it isn't too much?)
The Church numeral for N is a function of two arguments which applies
On Oct 8, 8:41 am, Alain Ketterlin al...@dpt-info.u-strasbg.fr
wrote:
candide cand...@free.invalid writes:
Python provides
-- the not operator, meaning logical negation
-- the in operator, meaning membership
On the other hand, Python provides the not in operator meaning
On Sat, 15 Oct 2011 15:04:24 -0700, DevPlayer wrote:
1. I thought x not in y was later added as syntax sugar for not x in
y
meaning they used the same set of tokens. (Too lazy to check the actual
tokens)
Whether the compiler has a special token for not in is irrelevant.
Perhaps it uses one
Chris Angelico writes:
On Sun, Oct 9, 2011 at 12:07 AM, Jussi Piitulainen wrote:
But both negations can be avoided by modus tollens.
If you are able to start the car, the key is in the ignition.
But this translation implies looking at the result and ascertaining
the state, which is less
Tim Roberts wrote:
Westley Martínez aniko...@gmail.com wrote:
On Sat, Oct 08, 2011 at 12:34:42PM -0400, Roy Smith wrote:
Here's my take on parenthesis: If you need to look up whether they're
necessary or not, they are :-)
So we don't need precedence charts in the bathroom?
Yes, we do,
On Tue, 11 Oct 2011 04:33:43 +1100, Chris Angelico wrote:
The Church numeral for N is a function of two arguments which applies its
first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).
Thanks - nice clear explanation. Appreciated. For an encore, can you
give an example
On Tue, Oct 11, 2011 at 7:28 PM, Nobody nob...@nowhere.com wrote:
It's useful insofar as it allows you to define numbers given nothing
other than abstraction and application, which are the only operations
available in the lambda calculus.
Heh. This is why mathematicians ALWAYS make use of
As you see, this way of writing constants gives you much more poetic
freedom than in other programming languages.
On Tue, Oct 11, 2011 at 7:46 PM, Chris Angelico ros...@gmail.com wrote:
On Tue, Oct 11, 2011 at 7:28 PM, Nobody nob...@nowhere.com wrote:
It's useful insofar as it allows you to
On 08.10.2011 18:08, Steven D'Aprano wrote:
Let's define the boolean values and operators using just two functions:
[SNIP]
Have you just explained Church booleans in an understandable
language? Awesome. I still have to chew on this, but I think this is
the first time where I might
On Oct 8, 5:01 am, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
Who like that second one speaks?
Yoda his name is. Programs in Forth he must.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Roy Smith wrote:
If you want to take it one step further, all the boolean operators can
be derived from nand (the dualists would insist on using nor).
Let's define the boolean values and operators
Alec Taylor alec.tayl...@gmail.com writes:
On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
def true(x, y):
return x
def false(x, y):
return y
[...]
def Nand(a, b):
return (lambda c: lambda x, y: c(y, x))(a(b, a))
and we're done.
Unfortunately I don't know lambda [or for that matter, regular] calculus...
On Tue, Oct 11, 2011 at 12:01 AM, Alain Ketterlin
al...@dpt-info.u-strasbg.fr wrote:
Alec Taylor alec.tayl...@gmail.com writes:
On Sun, Oct 9, 2011 at 3:08 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info
Le 10/10/2011 10:06, John Ladasky a écrit :
Who like that second one speaks?
Yoda his name is. Programs in Forth he must.
;)
We can add to the list :
-- Tarzan
-- Geronimo
-- don Alexandro de la Vega dying in the arms of Zorro
...
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 09 Oct 2011 02:25:27 +0200, Alexander Kapps wrote:
Even if it's off-topic, could you add some similar explanations for
Church numerals (maybe Lambda calculus it isn't too much?)
The Church numeral for N is a function of two arguments which applies its
first argument N times to its
On Tue, Oct 11, 2011 at 4:29 AM, Nobody nob...@nowhere.com wrote:
The Church numeral for N is a function of two arguments which applies its
first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).
Thanks - nice clear explanation. Appreciated. For an encore, can you
give an
On Mon, Oct 10, 2011 at 11:33 AM, Chris Angelico ros...@gmail.com wrote:
On Tue, Oct 11, 2011 at 4:29 AM, Nobody nob...@nowhere.com wrote:
The Church numeral for N is a function of two arguments which applies its
first argument N times to its second, i.e. (f^N)(x) = f(f(...(f(x))...)).
On 10/10/2011 1:55 PM, Ian Kelly wrote:
On Mon, Oct 10, 2011 at 11:33 AM, Chris Angelicoros...@gmail.com wrote:
On Tue, Oct 11, 2011 at 4:29 AM, Nobodynob...@nowhere.com wrote:
The Church numeral for N is a function of two arguments which applies its
first argument N times to its second,
Westley Martínez aniko...@gmail.com wrote:
On Sat, Oct 08, 2011 at 12:34:42PM -0400, Roy Smith wrote:
Here's my take on parenthesis: If you need to look up whether they're
necessary or not, they are :-)
So we don't need precedence charts in the bathroom?
Yes, we do, because I'm always
In article qotr52nlji7@ruuvi.it.helsinki.fi,
Jussi Piitulainen jpiit...@ling.helsinki.fi wrote:
Mel writes:
Steven D'Aprano wrote:
candide wrote:
So what is the usefulness of the not in operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one
On Sat, Oct 08, 2011 at 12:34:42PM -0400, Roy Smith wrote:
In article 4e906108$0$27980$426a3...@news.free.fr,
candide candide@free.invalid wrote:
After browsing source code, I realize that parenthesis are not necessary
(not has higher precedence than in).
Here's my take on
'th' not in python
False
not ('th' in python)
False
So what is the usefulness of the not in operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
--
http://mail.python.org/mailman/listinfo/python-list
not in
expression using only not and in operation. For instance
'th' not in python
False
not ('th' in python)
False
So what is the usefulness of the not in operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
You would
So what is the usefulness of the not in operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
the zen of python also says (amongst other things):
...
Readability counts.
...
Although practicality beats purity
...
Best regards
candide wrote:
So what is the usefulness of the not in operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
And not in is the obvious way to do it.
If the key is not in the ignition, you won't be able to start the car
candide candide@free.invalid writes:
Python provides
-- the not operator, meaning logical negation
-- the in operator, meaning membership
On the other hand, Python provides the not in operator meaning
non-membership. However, it seems we can reformulate any not in
expression using
Steven D'Aprano wrote:
candide wrote:
So what is the usefulness of the not in operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
And not in is the obvious way to do it.
If the key is not in the ignition, you won't
Mel writes:
Steven D'Aprano wrote:
candide wrote:
So what is the usefulness of the not in operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
And not in is the obvious way to do it.
If the key
In article 87ehyn8xlp@dpt-info.u-strasbg.fr,
Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote:
Sure, but note that you can also reformulate != using not and ==,
using not and =, etc. Operators like not in and is not should
really be considered single tokens, even though they seem to use
Le 08/10/2011 14:41, Alain Ketterlin a écrit :
Operators like not in and is not should
really be considered single tokens, even though they seem to use not.
And I think they are really convenient.
I realize that I was confused by the lexical form of the not in
operator : it is made by
Le 08/10/2011 14:01, Steven D'Aprano a écrit :
And not in is the obvious way to do it.
Obvious ? Not so. I performed some code mining and it appears that even
good sources make use of not (foo in bar) expressions.
begin examples ***
from
Le 08/10/2011 12:42, candide a écrit :
not ('th' in python)
False
After browsing source code, I realize that parenthesis are not necessary
(not has higher precedence than in).
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Oct 9, 2011 at 1:40 AM, candide candide@free.invalid wrote:
A notin operator or isnot operator would be less confusing (at least in my
case ;) ).
Let's replace both of them.
in -- foo extant bar
not in -- foo extinct bar
That would solve the problem, wouldn't it?
*ducking for cover*
Le 08/10/2011 12:50, Jon Clements a écrit :
10 - 5 as 10 + -5 (as obviously the - is redundant as an operation),
and 10 / 2 as int(10 * .5) or something, who needs a divide!?
OK, I see your point but I was supposing non-membershipness seldom
needed and in fact one can suppose that test
* candide (Sat, 08 Oct 2011 16:41:11 +0200)
After browsing source code, I realize that parenthesis are not
necessary (not has higher precedence than in).
Lower precedence.
Thorsten
--
http://mail.python.org/mailman/listinfo/python-list
On 01/-10/-28163 02:59 PM, candide wrote:
Le 08/10/2011 12:42, candide a écrit :
not ('th' in python)
False
After browsing source code, I realize that parenthesis are not
necessary (not has higher precedence than in).
You should say
... parenthesis are not necessary (not has
Le 08/10/2011 17:13, Thorsten Kampe a écrit :
* candide (Sat, 08 Oct 2011 16:41:11 +0200)
After browsing source code, I realize that parenthesis are not
necessary (not has higher precedence than in).
Lower precedence.
Ooops, thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Oct 9, 2011 at 2:16 AM, Dave Angel d...@davea.name wrote:
You should say
... parenthesis are not necessary (not has LOWER precedence than
in).
Is are not an operator in English, or should this be not
parentheses are necessary?
ChrisA
--
On 2011-10-08, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
candide wrote:
So what is the usefulness of the not in operator ? Recall what Zen of
Python tells
There should be one-- and preferably only one --obvious way to do it.
And not in is the obvious way to do
Roy Smith wrote:
If you want to take it one step further, all the boolean operators can
be derived from nand (the dualists would insist on using nor).
Let's define the boolean values and operators using just two functions:
def true(x, y):
return x
def false(x, y):
return y
That's
Le 08/10/2011 17:16, Dave Angel a écrit :
You should say
... parenthesis are not necessary (not has LOWER precedence than in).
I should, yes, I confess ;)
In my defense, I must tell that Python document reference here :
http://docs.python.org/reference/expressions.html#summary
has an
candide wrote:
Le 08/10/2011 14:01, Steven D'Aprano a écrit :
And not in is the obvious way to do it.
Obvious ? Not so. I performed some code mining and it appears that even
good sources make use of not (foo in bar) expressions.
All that proves is that even expert Python developers
In article 4e906108$0$27980$426a3...@news.free.fr,
candide candide@free.invalid wrote:
After browsing source code, I realize that parenthesis are not necessary
(not has higher precedence than in).
Here's my take on parenthesis: If you need to look up whether they're
necessary or not, they
On Oct 8, 6:31 pm, Roy Smith r...@panix.com wrote:
In article 87ehyn8xlp@dpt-info.u-strasbg.fr,
Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote:
Sure, but note that you can also reformulate != using not and ==,
using not and =, etc. Operators like not in and is not should
really
On Sun, Oct 9, 2011 at 3:31 AM, rusi rustompm...@gmail.com wrote:
If you want to take it one step further, all the boolean operators can
be derived from nand (the dualists would insist on using nor).
I'm not sure what you're questioning, but it's
In article
acd018ad-8428-4c3d-8aa0-15c4a410f...@x31g2000prd.googlegroups.com,
rusi rustompm...@gmail.com wrote:
On Oct 8, 6:31 pm, Roy Smith r...@panix.com wrote:
In article 87ehyn8xlp@dpt-info.u-strasbg.fr,
Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote:
Sure, but note that
Roy Smith r...@panix.com wrote:
In article 4e906108$0$27980$426a3...@news.free.fr,
candide candide@free.invalid wrote:
After browsing source code, I realize that parenthesis are not necessary
(not has higher precedence than in).
Here's my take on parenthesis: If you need to look up whether
On 09.10.2011 01:35, Tim Roberts wrote:
Roy Smithr...@panix.com wrote:
In article4e906108$0$27980$426a3...@news.free.fr,
candidecandide@free.invalid wrote:
After browsing source code, I realize that parenthesis are not necessary
(not has higher precedence than in).
Here's my take on
I sent this email twelve hours ago but to the wrong mailing list
*blush*. Since nobody else has raised the point, I'll repost it.
On Sun, Oct 9, 2011 at 12:07 AM, Jussi Piitulainen
jpiit...@ling.helsinki.fi wrote:
But both negations can be avoided by modus tollens.
If you are able to start the
In article mailman.1841.1318123788.27778.python-l...@python.org,
Chris Angelico ros...@gmail.com wrote:
I sent this email twelve hours ago but to the wrong mailing list
*blush*. Since nobody else has raised the point, I'll repost it.
On Sun, Oct 9, 2011 at 12:07 AM, Jussi Piitulainen
51 matches
Mail list logo