[Python-Dev] Floating point test_pow failure on the alpha Debian buildbot

2007-07-26 Thread Nick Coghlan
test_pow is failing on the alpha Debian buildbot, complaining that a 
negative number can't be raised to a fractional power. Now, to work 
around some bugs in platform implementations of math.fpow(), pow() does 
its own check to see if the exponent is an integer.

The way pow() does that check is to try "iw == floor(iw)", so to see why 
the exception was being triggered, I put a couple of extra output lines 
into the test and got:

*** Number: 1.2299e+167
*** Floor: 1.2297e+167

Given that the magnitude of the exponent significantly exceeds the 
precision of an IEEE double, it seems wrong for floor() to be changing 
the mantissa like that (and, on my machine, and all of the other 
buildbots, it doesn't).

I've added an explicit test for this misbehaviour to test_math so at 
least the buildbot gives a clearer indication of what's going wrong, but 
I'm not sure what to do with it beyond that.

Cheers,
Nick.




-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---
 http://www.boredomandlaziness.org
___
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


[Python-Dev] test_asyncore fails intermittently on Darwin

2007-07-26 Thread Hasan Diwan
test_asyncore fails intermittently on Darwin in trunk rev 56558; it
seems a matter of executing the test too fast and not waiting for the
TCP_WAIT state to expire. I think somebody encountered this problem
previously with another module (socket_server) and I'm unsure how that
was sorted.
-- 
Cheers,
Hasan Diwan <[EMAIL PROTECTED]>
___
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] [OT] Monospaced fonts

2007-07-26 Thread Greg Ewing
Georg Brandl wrote:
> I couldn't live without monospaced fonts for
> source code.  Apart from being easier to read, it is essential for sketches
> or things that must be aligned, such as the class schema in SocketServer.py.

This just goes to show we're living in the dark
ages wrt source code representation. We should
be able to write our comments in HTML with
embedded SVG diagrams. :-)

-- 
Greg Ewing, Computer Science Dept, +--+
University of Canterbury,  | Carpe post meridiem! |
Christchurch, New Zealand  | (I'm not a morning person.)  |
[EMAIL PROTECTED]  +--+
___
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] Two spaces or one?

2007-07-26 Thread Greg Ewing
[EMAIL PROTECTED] wrote:
> Me, I find it easier
> to read code which is displayed or printed with monospaced fonts.  Note,
> however, that I've been programming for 30 years.  I started with IBM punch
> cards, so I might be a bit biased.

I normally use monospaced fonts for Python, but in my
Think Pascal days I wrote most of my Pascal in Geneva.
I thought it actually looked quite nice that way,
especially with TP's auto-formatting.

It depends a lot on the font, though -- I don't think
I'd like to program in Times, for instance.

-- 
Greg Ewing, Computer Science Dept, +--+
University of Canterbury,  | Carpe post meridiem! |
Christchurch, New Zealand  | (I'm not a morning person.)  |
[EMAIL PROTECTED]  +--+
___
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] Two spaces or one?

2007-07-26 Thread Greg Ewing
Pete Forman wrote:
> Why do programming languages
> continue to assume use of a monospaced font?

Programming *languages* don't -- I know of no
(serious[1]) language that requires a monospaced font
in order to work correctly. Even in Python, as long
as you don't mix tabs and spaces, indentation still
works since it's all at the beginning of a line.

Certain *conventions* sometimes used by programmers
might require it, but that's a different thing.

[1] Brainf**k is an obvious exception.

-- 
Greg Ewing, Computer Science Dept, +--+
University of Canterbury,  | Carpe post meridiem! |
Christchurch, New Zealand  | (I'm not a morning person.)  |
[EMAIL PROTECTED]  +--+
___
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] test_asyncore fails intermittently on Darwin

2007-07-26 Thread Alan McIntyre
Thanks Hasan, I'll see if I can dig up what they did and make some
changes to fix the asyncore tests.

Regards,
Alan

On 7/26/07, Hasan Diwan <[EMAIL PROTECTED]> wrote:
> test_asyncore fails intermittently on Darwin in trunk rev 56558; it
> seems a matter of executing the test too fast and not waiting for the
> TCP_WAIT state to expire. I think somebody encountered this problem
> previously with another module (socket_server) and I'm unsure how that
> was sorted.
> --
> Cheers,
> Hasan Diwan <[EMAIL PROTECTED]>
> ___
> 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/alan.mcintyre%40gmail.com
>
___
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] Two spaces or one?

2007-07-26 Thread Josiah Carlson

[EMAIL PROTECTED] wrote:
> 
> 
> Pete> That points towards a way forward.  Why do programming languages
> Pete> continue to assume use of a monospaced font?  It was natural when
> Pete> we used punch cards and line printers, but now?  Python relies on
> Pete> the indentation but could be flexible about other textual
> Pete> attributes.
> 
> Nothing in Python assumes anything about fonts.  That's all a function of
> the text editor you use and your editing preferences.  Me, I find it easier
> to read code which is displayed or printed with monospaced fonts.  Note,
> however, that I've been programming for 30 years.  I started with IBM punch
> cards, so I might be a bit biased.

I started in '98, and I also find monospaced fonts easier to read in
various circumstances (email, code, shells, etc.).  But indeed, Python
makes no assumption about fonts.  A person could use Wingdings for all
Python cares.

 - Josiah

___
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] Two spaces or one?

2007-07-26 Thread skip

Pete> That points towards a way forward.  Why do programming languages
Pete> continue to assume use of a monospaced font?  It was natural when
Pete> we used punch cards and line printers, but now?  Python relies on
Pete> the indentation but could be flexible about other textual
Pete> attributes.

Nothing in Python assumes anything about fonts.  That's all a function of
the text editor you use and your editing preferences.  Me, I find it easier
to read code which is displayed or printed with monospaced fonts.  Note,
however, that I've been programming for 30 years.  I started with IBM punch
cards, so I might be a bit biased.

Skip
___
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] Two spaces or one?

2007-07-26 Thread Stephen J. Turnbull
[EMAIL PROTECTED] writes:

 > I started with IBM punch cards

Definitely a character cell format.
___
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] Two spaces or one?

2007-07-26 Thread Bill Janssen
> The term "French Spacing" is used for two spaces after a period ending
> a sentence, for those wishing to do more research.  I have not found
> any authoritative answer.

This phrase sounded to me like one of the slurs the English invented
during their various wars with the Dutch and the French (e.g. "Dutch
courage"), so I looked into it a bit.

The practice of double-spacing after a period was standard even with
proportional fonts before the advent of the Linotype machine, the
mechanical design of which didn't accommodate it.

See http://webword.com/reports/period.html.

``If the [Linotype machine] operator typed two spaces in a row, you
had two wedges next to each other, and that tended to gum up the
operation.  Clients who insisted could be accommodated by typing an
en-space followed by a justifier-space, but printers charged extra for
it and ridiculed it as 'French Spacing, oo-la-la, you want it all
fancy, huh? Well it'll cost ya, bub, and plenty too...' and soon it
became unfashionable in the US.''

Bill
___
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] Floating point test_pow failure on the alpha Debian buildbot

2007-07-26 Thread Tim Peters
[Nick Coghlan]
> test_pow is failing on the alpha Debian buildbot, complaining that a
> negative number can't be raised to a fractional power. Now, to work
> around some bugs in platform implementations of math.fpow(), pow() does
> its own check to see if the exponent is an integer.
>
> The way pow() does that check is to try "iw == floor(iw)", so to see why
> the exception was being triggered, I put a couple of extra output lines
> into the test and got:
>
> *** Number: 1.2299e+167
> *** Floor: 1.2297e+167
>
> Given that the magnitude of the exponent significantly exceeds the
> precision of an IEEE double, it seems wrong for floor() to be changing
> the mantissa like that

It is wrong -- the machine representation of test_pow's 1.23e167
literal is an exact integer on any current box, and the floor of any
exact integer is the integer itself.

> (and, on my machine, and all of the other buildbots, it doesn't).
>
> I've added an explicit test for this misbehaviour to test_math so at
> least the buildbot gives a clearer indication of what's going wrong, but
> I'm not sure what to do with it beyond that.

This isn't Python's problem -- a bug report should be opened against
the platform C's implementation of floor(), and the test /should/ fail
in Python so long as the platform floor() remains broken.
___
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


[Python-Dev] [OT] Monospaced fonts

2007-07-26 Thread Georg Brandl
[EMAIL PROTECTED] schrieb:
> Pete> That points towards a way forward.  Why do programming languages
> Pete> continue to assume use of a monospaced font?  It was natural when
> Pete> we used punch cards and line printers, but now?  Python relies on
> Pete> the indentation but could be flexible about other textual
> Pete> attributes.
> 
> Nothing in Python assumes anything about fonts.  That's all a function of
> the text editor you use and your editing preferences.  Me, I find it easier
> to read code which is displayed or printed with monospaced fonts.  Note,
> however, that I've been programming for 30 years.  I started with IBM punch
> cards, so I might be a bit biased.

Though being notably younger ;), I couldn't live without monospaced fonts for
source code.  Apart from being easier to read, it is essential for sketches
or things that must be aligned, such as the class schema in SocketServer.py.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
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] Two spaces or one?

2007-07-26 Thread Pete Forman
The term "French Spacing" is used for two spaces after a period ending
a sentence, for those wishing to do more research.  I have not found
any authoritative answer.  The balance has been towards two spaces
when using a monospaced font.

That points towards a way forward.  Why do programming languages
continue to assume use of a monospaced font?  It was natural when we
used punch cards and line printers, but now?  Python relies on the
indentation but could be flexible about other textual attributes.
-- 
Pete Forman-./\.-  Disclaimer: This post is originated
WesternGeco  -./\.-   by myself and does not represent
[EMAIL PROTECTED]-./\.-   the opinion of Schlumberger or
http://petef.port5.com   -./\.-   WesternGeco.

___
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


[Python-Dev] Weekly Python Patch/Bug Summary

2007-07-26 Thread Kurt B. Kaiser
Patch / Bug Summary
___

Patches :  399 open ( +5) /  3836 closed ( +9) /  4235 total (+14)
Bugs: 1056 open (+10) /  6776 closed ( +3) /  7832 total (+13)
RFE :  263 open ( +1) /   294 closed ( +1) /   557 total ( +2)

New / Reopened Patches
__

utilize 2.5 try/except/finally in contextlib  (2007-07-19)
   http://python.org/sf/1757118  opened by  Philip Jenvey

Fix ptcp154 encoding cyrillic_asian alias  (2007-07-19)
   http://python.org/sf/1757126  opened by  Philip Jenvey

Add support for seeking/writing beyond EOF to io.BytesIO  (2007-07-20)
CLOSED http://python.org/sf/1757683  opened by  Alexandre Vassalotti

struni: make test_ucn pass  (2007-07-20)
CLOSED http://python.org/sf/1757758  opened by  Alexandre Vassalotti

struni: fix str/bytes errors for test_oldmailbox  (2007-07-20)
CLOSED http://python.org/sf/1757774  opened by  Alexandre Vassalotti

setuptools support for bazaar vcs  (2007-07-20)
CLOSED http://python.org/sf/1757782  opened by  Barry A. Warsaw

struni: make test_mailbox and test_old_mailbox pass  (2007-07-20)
CLOSED http://python.org/sf/1757839  opened by  Alexandre Vassalotti

struni: Fix test_macostools  (2007-07-22)
CLOSED http://python.org/sf/1758570  opened by  Jeffrey Yasskin

pyexpat unit tests - str/uni branch  (2007-07-23)
CLOSED http://python.org/sf/1759016  opened by  Joe Gregorio

clean up Solaris port and allow C99 extension modules  (2007-07-23)
   http://python.org/sf/1759169  opened by  Zooko O'Whielacronx

struni pulldom: Don't use 'types' to check strings  (2007-07-24)
   http://python.org/sf/1759922  opened by  Alexandre Vassalotti

Cross Compiling Python  (2007-07-25)
   http://python.org/sf/1760089  opened by  Yegnesh

ZipFile.write fails with bad modification time  (2007-07-25)
   http://python.org/sf/1760357  opened by  Grzegorz Adam Hankiewicz

struni: Fix test_aepack by converting 4cc's to bytes  (2007-07-26)
   http://python.org/sf/1761465  opened by  Jeffrey Yasskin

Patches Closed
__

Show Location of Unicode Escape Errors  (2007-07-18)
   http://python.org/sf/1755885  closed by  gvanrossum

Add support for seeking/writing beyond EOF to io.BytesIO  (2007-07-20)
   http://python.org/sf/1757683  closed by  gvanrossum

struni: make test_ucn pass  (2007-07-20)
   http://python.org/sf/1757758  closed by  gvanrossum

struni: fix str/bytes errors for test_oldmailbox  (2007-07-20)
   http://python.org/sf/1757774  closed by  avassalotti

setuptools support for bazaar vcs  (2007-07-20)
   http://python.org/sf/1757782  closed by  pje

struni: make test_mailbox and test_old_mailbox pass  (2007-07-20)
   http://python.org/sf/1757839  closed by  gvanrossum

PEP 3123 implementation  (2007-05-13)
   http://python.org/sf/1718153  closed by  loewis

struni: Fix test_macostools  (2007-07-22)
   http://python.org/sf/1758570  closed by  gvanrossum

pyexpat unit tests - str/uni branch  (2007-07-23)
   http://python.org/sf/1759016  closed by  gvanrossum

New / Reopened Bugs
___

Python 2.5.1 fails to build on AIX  (2007-07-18)
   http://python.org/sf/1756343  opened by  Tom Epperly

reference count discrepancy, PyErr_Print vs. PyErr_Clear  (2007-07-18)
   http://python.org/sf/1756389  opened by  Jon Klein

IDLE + BeautifulSoup = Error  (2007-07-19)
   http://python.org/sf/1757057  opened by  Tal Einat

Pickle fails on BeautifulSoup's navigableString instances  (2007-07-19)
   http://python.org/sf/1757062  opened by  Tal Einat

Zipfile robustness  (2007-07-19)
   http://python.org/sf/1757072  opened by  Chris Mellon

Crash in PyObject_Malloc  (2007-07-21)
   http://python.org/sf/1758146  opened by  Tim Bishop

Documentation of descriptors needs more detail  (2007-07-22)
   http://python.org/sf/1758696  opened by  L. Peter Deutsch

unicode(None,charset) raise TypeError  (2007-07-23)
   http://python.org/sf/1758804  opened by  Guillaume

subprocess.call fails with unicode strings in command line  (2007-07-24)
   http://python.org/sf/1759845  opened by  Matt

poll() on cygwin sometimes fails [PATCH]  (2007-07-24)
   http://python.org/sf/1759997  opened by  Brian Warner

No docs for list comparison  (2007-07-25)
   http://python.org/sf/1760423  opened by  Kent Johnson

logging.FileHandler may throw exception in flush()  (2007-07-25)
   http://python.org/sf/1760556  opened by  J Livingston

pickle - cannot unpickle circular deps with custom __hash__  (2007-07-26)
   http://python.org/sf/1761028  opened by  Martin Süßkraut

Bugs Closed
___

struni: help() is broken  (2007-07-11)
   http://python.org/sf/1751932  closed by  kbk

Docstring for codecs.lookup is incorrect  (2007-07-15)
   http://python.org/sf/1754453  closed by  doerwalter

New / Reopened RFE
__

splice() function for itertools  (2007-07-20)
CLOSED http://python.org/sf/1757395  opened by  Alexander Dutton

Allow 

[Python-Dev] interaction between locals, builtins and except clause

2007-07-26 Thread Lisandro Dalcin
Porting to Py3K, I modified a function like the followin, using a
trick for it working in Py2.x .

def __iter__(self):
if self == _mpi.INFO_NULL:
return
try:range = xrange
except: pass
nkeys = _mpi.info_get_nkeys(self)
for nthkey in range(nkeys):
yield _mpi.info_get_nthkey(self, nthkey)

However, I've got in my unittests (running with py3k)

ERROR: testPyMethods (__main__.TestInfo)
--
Traceback (most recent call last):
  File "tests/unittest/test_info.py", line 123, in testPyMethods
for key in INFO:
  File "/u/dalcinl/lib/python/mpi4py/MPI.py", line 937, in __iter__
for nthkey in range(nkeys):
UnboundLocalError: local variable 'range' referenced before assignment


I am not completelly sure if this is expected (it is, regarding
implementation, but perhaps not regarding Python as a language),  so
I post this for your consideration.


-- 
Lisandro Dalcín
---
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
___
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] interaction between locals, builtins and except clause

2007-07-26 Thread Georg Brandl
Lisandro Dalcin schrieb:
> Porting to Py3K, I modified a function like the followin, using a
> trick for it working in Py2.x .
> 
> def __iter__(self):
> if self == _mpi.INFO_NULL:
> return
> try:range = xrange
> except: pass
> nkeys = _mpi.info_get_nkeys(self)
> for nthkey in range(nkeys):
> yield _mpi.info_get_nthkey(self, nthkey)
> 
> However, I've got in my unittests (running with py3k)
> 
> ERROR: testPyMethods (__main__.TestInfo)
> --
> Traceback (most recent call last):
>   File "tests/unittest/test_info.py", line 123, in testPyMethods
> for key in INFO:
>   File "/u/dalcinl/lib/python/mpi4py/MPI.py", line 937, in __iter__
> for nthkey in range(nkeys):
> UnboundLocalError: local variable 'range' referenced before assignment
> 
> 
> I am not completelly sure if this is expected (it is, regarding
> implementation, but perhaps not regarding Python as a language),  so
> I post this for your consideration.

Yes, this is expected. By an assignment to range anywhere in a function
scope, the name is marked as a local and won't ever be looked up in the
global namespace.

I'd move the range = xrange part at the module top, or just bring the 2.x
version in a state where one run of 2to3 produces a working 3.0 version.

HTH,
Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
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] [OT] Monospaced fonts

2007-07-26 Thread Georg Brandl
Greg Ewing schrieb:
> Georg Brandl wrote:
>> I couldn't live without monospaced fonts for
>> source code.  Apart from being easier to read, it is essential for sketches
>> or things that must be aligned, such as the class schema in SocketServer.py.
> 
> This just goes to show we're living in the dark ages wrt source code
> representation. We should be able to write our comments in HTML with
> embedded SVG diagrams. :-)

PowerPoint, coding edition?

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
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