Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Guido van Rossum
This won't change so just get used to it. Please move any further discussion to c.l.py. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] [Python-checkins] r53860 - peps/trunk/pep-0000.txt peps/trunk/pep-0358.txt

2007-02-22 Thread Guido van Rossum
[-python-checkins, +python-dev] On 2/22/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > > __setitem__ > > __setslice__ > > append > > count > > +decode > > +endswith > > extend > > +find > > index > > insert > > +

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Ron Adam
Larry Hastings wrote: > Neal Becker wrote: >> Instead, bool fails in _the worst possible way_: it silently gives a >> _wrong result_. > > I disagree with the word "fail" there; Python is working correctly. The > behavior of converting expressions to a boolean is well-defined: > http://docs.

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Stephen J. Turnbull
Neal Becker writes: > Well consider this: > >>>str (4) > '4' > >>>int(str (4)) > 4 > >>>str (False) > 'False' > > >>>bool(str(False)) > True > > Doesn't this seem a bit inconsisent? The former case is a *conversion* from an expression that *does not* have an interpretation in a nume

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Larry Hastings
Neal Becker wrote: Instead, bool fails in _the worst possible way_: it silently gives a _wrong result_. I disagree with the word "fail" there; Python is working correctly. The behavior of converting expressions to a boolean is well-defined: http://docs.python.org/ref/Booleans.html Perhaps

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Ben Wing
On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote: Mike Klaas wrote: > On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote: > >> Well consider this: >> >>>str (4) >> '4' >> >>>int(str (4)) >> 4 >> >>>str (False) >> 'False' >> >> >>>bool(str(False)) >> True >> >> Doesn't this seem a bit inconsisen

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Mike Klaas
On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote: > Except, all the numeric types do, including int, float, and complex. But > not bool. Oh? In [5]: str(complex(1, 2)) Out[5]: '(1+2j)' In [6]: complex(str(complex(1, 2)))

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Neal Becker
Mike Klaas wrote: > On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote: > >> Well consider this: >> >>>str (4) >> '4' >> >>>int(str (4)) >> 4 >> >>>str (False) >> 'False' >> >> >>>bool(str(False)) >> True >> >> Doesn't this seem a bit inconsisent? > > Virtually no python objects accept a stringif

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Mike Klaas
On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote: > Well consider this: > >>>str (4) > '4' > >>>int(str (4)) > 4 > >>>str (False) > 'False' > > >>>bool(str(False)) > True > > Doesn't this seem a bit inconsisent? Virtually no python objects accept a stringified version of themselves in their cons

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Neal Becker
Jonathan Lange wrote: > On 2/23/07, Neal Becker <[EMAIL PROTECTED]> wrote: >> >>> bool ('False') >> True >> > > Non-empty strings are considered True, empty strings are considered > False. This is not a wart, as the behaviour matches that of other > sequences. > Well consider this: >>>str (4) '

Re: [Python-Dev] bool conversion wart?

2007-02-22 Thread Jonathan Lange
On 2/23/07, Neal Becker <[EMAIL PROTECTED]> wrote: > >>> bool ('False') > True > Non-empty strings are considered True, empty strings are considered False. This is not a wart, as the behaviour matches that of other sequences. cheers, jml ___ Python-Dev

[Python-Dev] bool conversion wart?

2007-02-22 Thread Neal Becker
>>> int ('4') 4 >>> bool ('False') True ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Bundling decimal.py with Django

2007-02-22 Thread python
> What is the license for the decimal module, > and is said license compatible > with the BSD license that Django uses? It is the the same license as Python itself: http://www.python.org/psf/license/ > Are the authors of the decimal module OK > with usdistributing it with Django? You don't ne

[Python-Dev] Bundling decimal.py with Django

2007-02-22 Thread Andrew Durdin
Apologies if this is a little off-topic for python-dev, but it seemed like the best place to ask and get the attention of those needed. I am championing a patch to improve Django's support for numeric types by using Decimals with numeric columns and floats with double precision columns, rather tha

[Python-Dev] A Reminder : A Survey on Defect Management Practices in Free/Open Source Software

2007-02-22 Thread Anu Gupta DCSA
Sir/Madam I seek help from designers, developers, testers,defect fixers,project managers or playing any other key role in Free/Open Source software development or maintenence in carrying out a study to identify practices and problems of defect management in various Free/Open Source Software pr