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
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
>
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
> >>
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
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
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
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.
>
>> >
[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.
>
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
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
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=
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"
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
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
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
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
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
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,
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
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
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
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
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
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
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
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.
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
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:
> > >
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
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
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
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
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:
>
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
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
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
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
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
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) [
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
40 matches
Mail list logo