Re: Interesting list Validity (True/False)

2007-05-17 Thread Gabriel Genellina
En Fri, 18 May 2007 01:48:29 -0300, Alex Martelli <[EMAIL PROTECTED]> escribió: > The gmpy designer, writer and maintainer (all in the singular -- that's > me) has NOT chosen anything of the sort. gmpy.mpz does implement > __int__ and __long__ -- but '%d'%somempzinstance chooses not to call > eit

Re: Interesting list Validity (True/False)

2007-05-17 Thread Alex Martelli
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > import gmpy > a = 2**177149-1 > b = gmpy.mpz(2**177149-1) > a==b > > True > print '%d' % (b) > > > > Traceback (most recent call last): > > File "", line 1, in > > print '%d' % (b) > > TypeError: int argument required >

Re: Interesting list Validity (True/False)

2007-05-16 Thread [EMAIL PROTECTED]
On May 16, 4:12 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 16 May 2007 03:16:59 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > > > > > On May 15, 7:07 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> import gmpy > >> a = 2**177149-1 > >>

Re: Interesting list Validity (True/False)

2007-05-16 Thread Gabriel Genellina
En Wed, 16 May 2007 03:16:59 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > On May 15, 7:07 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> import gmpy >> a = 2**177149-1 >> b = gmpy.mpz(2**177149-1) >> a==b >> > True >> print '%d' % (b) >> >> > Traceb

Re: Interesting list Validity (True/False)

2007-05-15 Thread [EMAIL PROTECTED]
On May 15, 7:07 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 15 May 2007 14:01:20 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > On May 15, 12:30 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> And said section 5.9 should be updated too: "The objects need

Re: Interesting list Validity (True/False)

2007-05-15 Thread [EMAIL PROTECTED]
On May 15, 9:23�pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 14 May 2007 11:41:21 -0700, [EMAIL PROTECTED] wrote: > > On May 13, 8:24 am, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > >> On Sat, 12 May 2007 21:50:12 -0700, [EMAIL PROTECTED] wrote: > > > I intended to reply to this ye

Re: Interesting list Validity (True/False)

2007-05-15 Thread Steven D'Aprano
On Mon, 14 May 2007 11:41:21 -0700, [EMAIL PROTECTED] wrote: > On May 13, 8:24 am, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Sat, 12 May 2007 21:50:12 -0700, [EMAIL PROTECTED] wrote: > > I intended to reply to this yesterday, but circumstances (see timeit > results) prevented it. > >> >

Re: Interesting list Validity (True/False)

2007-05-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On May 12, 11:02�pm, Steven D'Aprano [ ... ] > > But you can't trust a==d returning True to mean a and d are > "equal". To say the comparison means the two objects are > equal is misleading, in other words, wrong. It only takes one > turd to spoil the whole punchbowl. >

Re: Interesting list Validity (True/False)

2007-05-15 Thread Gabriel Genellina
En Tue, 15 May 2007 14:01:20 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > On May 15, 12:30 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> And said section 5.9 should be updated too: "The objects need not have >> the >> same type. If both are numbers or strings, they are co

Re: Interesting list Validity (True/False)

2007-05-15 Thread [EMAIL PROTECTED]
On May 15, 12:30 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 15 May 2007 01:37:07 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > >> > > >> > Sec 2.2.3: > >> > Objects of different types, *--->except<---* different numeric types > >> > and different string types, ne

Re: Interesting list Validity (True/False)

2007-05-14 Thread Gabriel Genellina
En Tue, 15 May 2007 01:37:07 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: >> > >> > Sec 2.2.3: >> > Objects of different types, *--->except<---* different numeric types >> > and different string types, never compare equal; >> > >> >> The exceptions you mean are not exceptions to "'X=

Re: Interesting list Validity (True/False)

2007-05-14 Thread [EMAIL PROTECTED]
On May 14, 8:10?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Mon, 2007-05-14 at 11:41 -0700, [EMAIL PROTECTED] wrote: > > On May 13, 8:24 am, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > > > On Sat, 12 May 2007 21:50:12 -0700, [EMAIL PROTECTED] wrote: > > > >> > > > > >> > "if arg==True"

Re: Interesting list Validity (True/False)

2007-05-14 Thread Carsten Haese
On Mon, 2007-05-14 at 11:41 -0700, [EMAIL PROTECTED] wrote: > On May 13, 8:24 am, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: > > On Sat, 12 May 2007 21:50:12 -0700, [EMAIL PROTECTED] wrote: > > >> > > > >> > "if arg==True" tests whether the object known as arg is equal to the > > >> > object kno

Re: Interesting list Validity (True/False)

2007-05-14 Thread [EMAIL PROTECTED]
On May 13, 8:24 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 12 May 2007 21:50:12 -0700, [EMAIL PROTECTED] wrote: I intended to reply to this yesterday, but circumstances (see timeit results) prevented it. > >> > Actually, it's this statement that's non-sensical. > > >> > > >> > "if

Re: Interesting list Validity (True/False)

2007-05-14 Thread Gabriel Genellina
En Sun, 13 May 2007 23:45:22 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > On May 13, 2:09?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: >> There are no exceptions. > "...and when I say none, I mean there is a certain amount." One of the beautiful things about Python that I like, is h

Re: Interesting list Validity (True/False)

2007-05-13 Thread [EMAIL PROTECTED]
On May 13, 2:09?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Sun, 2007-05-13 at 09:26 -0700, [EMAIL PROTECTED] wrote: > There are no exceptions. "...and when I say none, I mean there is a certain amount." -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting list Validity (True/False)

2007-05-13 Thread Carsten Haese
On Sun, 2007-05-13 at 09:26 -0700, [EMAIL PROTECTED] wrote: > > The statement I made is simply the meaning of "if arg==True" by > > definition, so I don't see how it can be nonsensical. > > Because you didn't allow for exceptions, which are > prominently pointed out in the Python docs. I said: "i

Re: Interesting list Validity (True/False)

2007-05-13 Thread [EMAIL PROTECTED]
On May 13, 8:57?am, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Sat, 2007-05-12 at 18:43 -0700, [EMAIL PROTECTED] wrote: > > > That doesn't explain what you mean. How does "if arg==True" test whether > > > "a list is a boolean"? > > > >>> type(sys.argv) > > > > >>> type(True) > > > > All right,

Re: Interesting list Validity (True/False)

2007-05-13 Thread Carsten Haese
On Sat, 2007-05-12 at 18:43 -0700, [EMAIL PROTECTED] wrote: > > That doesn't explain what you mean. How does "if arg==True" test whether > > "a list is a boolean"? > > >>> type(sys.argv) > > >>> type(True) > All right, so what you meant was "Assuming that arg is a list, 'if arg==True' will alwa

Re: Interesting list Validity (True/False)

2007-05-13 Thread Steven D'Aprano
On Sat, 12 May 2007 21:50:12 -0700, [EMAIL PROTECTED] wrote: >> > Actually, it's this statement that's non-sensical. >> >> > >> > "if arg==True" tests whether the object known as arg is equal to the >> > object known as True. >> > >> >> Not at all, it makes perfect sense. X == Y always tests whe

Re: Interesting list Validity (True/False)

2007-05-12 Thread [EMAIL PROTECTED]
On May 12, 11:02�pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 12 May 2007 18:43:54 -0700, [EMAIL PROTECTED] wrote: > > On May 12, 8:10?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > >> On Sat, 2007-05-12 at 17:55 -0700, [EMAIL PROTECTED] wrote: > >> > On May 12, 12:56?pm, Carsten Haese

Re: Interesting list Validity (True/False)

2007-05-12 Thread Steven D'Aprano
On Sat, 12 May 2007 18:43:54 -0700, [EMAIL PROTECTED] wrote: > On May 12, 8:10?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: >> On Sat, 2007-05-12 at 17:55 -0700, [EMAIL PROTECTED] wrote: >> > On May 12, 12:56?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: >> > > On Fri, 2007-05-11 at 14:26 -0700, [E

Re: Interesting list Validity (True/False)

2007-05-12 Thread [EMAIL PROTECTED]
On May 12, 8:10?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Sat, 2007-05-12 at 17:55 -0700, [EMAIL PROTECTED] wrote: > > On May 12, 12:56?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > On Fri, 2007-05-11 at 14:26 -0700, [EMAIL PROTECTED] wrote: > > > > if arg==True: > > > > > tests the ty

Re: Interesting list Validity (True/False)

2007-05-12 Thread Carsten Haese
On Sat, 2007-05-12 at 17:55 -0700, [EMAIL PROTECTED] wrote: > On May 12, 12:56?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > On Fri, 2007-05-11 at 14:26 -0700, [EMAIL PROTECTED] wrote: > > > if arg==True: > > > > > tests the type property (whether a list is a boolean). > > > > That sounds nonsen

Re: Interesting list Validity (True/False)

2007-05-12 Thread [EMAIL PROTECTED]
On May 12, 12:56?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-11 at 14:26 -0700, [EMAIL PROTECTED] wrote: > > if arg==True: > > > tests the type property (whether a list is a boolean). > > That sounds nonsensical and incorrect. Please explain what you mean. Sec 2.2.3: Objects of

Re: Interesting list Validity (True/False)

2007-05-12 Thread Carsten Haese
On Fri, 2007-05-11 at 14:26 -0700, [EMAIL PROTECTED] wrote: > if arg==True: > > tests the type property (whether a list is a boolean). That sounds nonsensical and incorrect. Please explain what you mean. "if arg==True" tests whether the object known as arg is equal to the object known as True.

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
Just an update of my output after Carsten and company's advice: C:\Python25\rg.py>help.py -h help.py Version 1.0 Copyright RDEG (c) 2007 Options : -h, --help -- display this message Progam Exit (0) C:\Python25\rg.py>help.py -i print arg ['-i'] type(arg): arg is True? False

Re: Interesting list Validity (True/False)

2007-05-11 Thread [EMAIL PROTECTED]
On May 11, 3:36 pm, [EMAIL PROTECTED] wrote: > On May 11, 2:28 pm, [EMAIL PROTECTED] wrote: > > > > > > > > > > Hello all, > > > > First let me appologise if this has been answered but I could not find > > > an acurate answer to this interesting problem. > > > > If the following is true: > > >

Re: Interesting list Validity (True/False)

2007-05-11 Thread Rob Williscroft
wrote in news:[EMAIL PROTECTED] in comp.lang.python: > >>> [] == [] > True > >>> ['-o'] == [] > False > >>> ['-o'] == False > False > >>> To test wether something is true use if. To test wether something is false use if not. The python values "True" and "False" are

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 5:19 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-11 at 14:12 -0700, [EMAIL PROTECTED] wrote: > > However, how would you test for the falsness of the object arg? > > if not arg: ># stuff > > -- > Carsten Haesehttp://informixdb.sourceforge.net I think that is the ti

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 5:12 pm, [EMAIL PROTECTED] wrote: > On May 11, 5:07 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > > > > > On Fri, 2007-05-11 at 12:28 -0700, [EMAIL PROTECTED] wrote: > > > Hello all, > > > > First let me appologise if this has been answered but I could not find > > > an acurate answ

Re: Interesting list Validity (True/False)

2007-05-11 Thread Carsten Haese
On Fri, 2007-05-11 at 14:12 -0700, [EMAIL PROTECTED] wrote: > However, how would you test for the falsness of the object arg? if not arg: # stuff -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 5:07 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-11 at 12:28 -0700, [EMAIL PROTECTED] wrote: > > Hello all, > > > First let me appologise if this has been answered but I could not find > > an acurate answer to this interesting problem. > > > If the following is true: >

Re: Interesting list Validity (True/False)

2007-05-11 Thread Carsten Haese
On Fri, 2007-05-11 at 14:07 -0700, [EMAIL PROTECTED] wrote: > OK. Then how would you differenciate between a call with an option > versus one without (e.g. help.py -o (where arg == ['-o']) Vs. help.py > (where arg == []))? if arg: print "With options" else: print "Without options" -- Carsten

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 4:32 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On Fri, May 11, 2007 at 01:20:44PM -0700, [EMAIL PROTECTED] > wrote: > > > On May 11, 3:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > You got those results because that's what your program does. > > > > Were you intending it to

Re: Interesting list Validity (True/False)

2007-05-11 Thread Carsten Haese
On Fri, 2007-05-11 at 12:28 -0700, [EMAIL PROTECTED] wrote: > Hello all, > > First let me appologise if this has been answered but I could not find > an acurate answer to this interesting problem. > > If the following is true: > C:\Python25\rg.py>python > Python 2.5.1 (r251:54863, Apr 18

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 2:28 pm, [EMAIL PROTECTED] wrote: > > > > > > > Hello all, > > > First let me appologise if this has been answered but I could not find > > an acurate answer to this interesting problem. > > > If the following is true: > > C:\Python25\rg.py>python > > Python 2.5.1 (r251:54863, A

Re: Interesting list Validity (True/False)

2007-05-11 Thread Grant Edwards
On Fri, May 11, 2007 at 01:20:44PM -0700, [EMAIL PROTECTED] wrote: > On May 11, 3:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > > You got those results because that's what your program does. > > > > Were you intending it to do something else? If so, you're > > going to have to explain what you

Re: Interesting list Validity (True/False)

2007-05-11 Thread [EMAIL PROTECTED]
On May 11, 2:28 pm, [EMAIL PROTECTED] wrote: > Hello all, > > First let me appologise if this has been answered but I could not find > an acurate answer to this interesting problem. > > If the following is true: > C:\Python25\rg.py>python > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [

Re: Interesting list Validity (True/False)

2007-05-11 Thread Grant Edwards
On 2007-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Then why do I get the following results: > C:\Python25\rg.py>help.py -o > print arg ['-o'] > type(arg): > arg is True? False > help.py version 1.0 Copyright RDEG (c) 2007 > ['-o'] is an unrecognized opti

Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
Hello all, First let me appologise if this has been answered but I could not find an acurate answer to this interesting problem. If the following is true: C:\Python25\rg.py>python Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "c