[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David

Cournapeau David da...@ar.media.kyoto-u.ac.jp added the comment:

I disagree the feature is not needed, for several reasons:
 - complex(repr(..)) roundtrip should work, whatever the value of complex is
 - it is supported for float, so why not for complex ?
 - I believe on the contrary it solves a very real problem: incidently,
I got interested in this patch while working on numpy, and it is
certainly useful to be able to parse nan and inf (for example when we
create arrays from strings). Nan may be seen as non useful for so called
real usage of python, but for scientific people, it is a crucial to have
proper support of nan (which may mean missing data depending on the
context) and inf.
 - it does not add complexity: I would argue that independantly of
nan/inf support, my patch makes the function simpler to follow (no state
machine with done/sw_error/etc... state).

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2121
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

 complex(repr(..)) roundtrip should work,

Nice-to-have but not a requirement that the entire input domain be
supported. 

 it is supported for float, so why not for complex ?

It made sense for floats because of prevalence of use cases and because
we wanted to match IEEE-754R as much as possible.  Unfortunately, the
support for Infs and NaNs has already negatively impacted the float
world by making the math module harder to maintain and test.  I would
not like to see that extended to cmath or complex() unless compelling
real-world use cases arise.

 ... for scientific people, it is a crucial to have proper support
 of nan (which may mean missing data depending on the context) and inf.

Mark, does Inf have a standard interpretation for complex numbers?  Do
all infinities meet or do they radiate, each with their own phase angle?

Also, do you want to stick with the 754 interpretation of NaNs as the
result of invalid operations or are you comfortable with the
MatLab/Octave notion of using NaNs to indicate missing values (something
they do as an optimization because it is the only way to flag a
non-numeric value in a floating point register or C double)?

 it does not add complexity: 

That depends on whether handling of NaNs and Infs creeps into cmath.  

Mainly, I'm just questioning whether there exist compelling use cases
for parsing NaNs and Infs in the context of complex numbers.

--
assignee:  - marketdickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2121
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David

Cournapeau David da...@ar.media.kyoto-u.ac.jp added the comment:

 Nice-to-have but not a requirement that the entire input domain be
 supported.

Ok.

 It made sense for floats because of prevalence of use cases and 
 because we wanted to match IEEE-754R as much as possible.

But why shouldn't this apply to complex numbers ? I am biased because I
mainly use python for scientific work, but complex numbers are not more
special than float in my mind.

 Unfortunately, the support for Infs and NaNs has already negatively 
 impacted the float world by making the math module harder to maintain
 and test.

Yes, it is difficult to handle nan and inf, there are a lot of corner
cases. But I fail to see how this applies here: my patch is essentially
a rewrote of the parsing, and the code to handle nan/inf is only 7
lines. This is independent of the handling of how nan/inf is handled by
math operations on it.

 Mark, does Inf have a standard interpretation for complex numbers?
 Do all infinities meet or do they radiate, each with their own phase 
angle?

Hm, not sure what you mean here by standard interpretation, but
infinities do not meet, in the sense that (x,inf) and (inf,x) for
example can never been 'near' from each other (in the distance sense),
except if x is inf. It does not make more sense to talk about phase of
complex numbers with inf than for 0. But again, I don't see how this is
relevant to the proposed feature. 

 Mainly, I'm just questioning whether there exist compelling use cases
 for parsing NaNs and Infs in the context of complex numbers.

For any task where parsing complex makes sense. Since many numerical
operations may end up with nan or inf, this is relatively common I would
say.

It this can make the review easier, I can split the patch in two: first
the refactoring (+ tests once someone tells me how to), and then 
inf/nan handling (with additional tests).

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2121
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David

Cournapeau David da...@ar.media.kyoto-u.ac.jp added the comment:

Ok, I found out how to make tests, and I found some problems while using
this on numpy. A third version of the patch, with unit tests: all tests
in test_complex.py pass.

Added file: http://bugs.python.org/file12504/nan_parse.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2121
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David

Changes by Cournapeau David da...@ar.media.kyoto-u.ac.jp:


Removed file: http://bugs.python.org/file12503/nan_parse.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2121
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2121] complex constructor doesn't accept string with nan and inf

2008-12-31 Thread Cournapeau David

Changes by Cournapeau David da...@ar.media.kyoto-u.ac.jp:


Removed file: http://bugs.python.org/file12502/nan_parse.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2121
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4263] BufferedWriter non-blocking overage

2008-12-31 Thread Sever Băneșiu

Sever Băneșiu banesiu.se...@gmail.com added the comment:

Thanks for the new implementation of MockNonBlockWriterIO class. It
makes tests so much easier to read.

There are some minor things in your patch that I would change. For example:

# 1 byte will be written, the rest will be buffered
raw.block_on(bk)
self.assertEquals(bufio.write(bjklmn), 5)
# ...
raw.block_on(b0)

The comment is misleading because in fact no byte is written at raw
level. That's because the data size is smaller than the buffer size and
the buffer is empty (was emptied by the last write call). All this
renders raw.block_on(bk) call useless. I also think this is the
correct behavior regardless of implementation language of BufferedWriter
class i.e. no write call should write at raw level smaller chunks of
data than buffer's size unless it has to.

Your tests can't cover the pre-flush condition because max_buffer_size
equals buffer_size.

Unless you'll beat me to it or prove me wrong, I'll update your patch
next year.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4787] Curses Unicode Support

2008-12-31 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Python 2.5 also requires the addition of libcursesw 
 but it was working for the Ubuntu release because 
 they specifically added it.

What do you mean by the addition of libcursesw? _curses.so of Python 
2.5 is linked to libncursesw.so on Ubuntu Gutsy and Hardy.

If _curses.so is linked to libncurses.so, you can not used multibyte 
charset like UTF-8.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4787
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4263] BufferedWriter non-blocking overage

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 The comment is misleading because in fact no byte is written at raw
 level. That's because the data size is smaller than the buffer size and
 the buffer is empty (was emptied by the last write call).

It depends on the implementation. A different implementation may use a
different algorithm.

 I also think this is the
 correct behavior regardless of implementation language of BufferedWriter
 class i.e. no write call should write at raw level smaller chunks of
 data than buffer's size unless it has to.

But how do you decide when it has to? Unless you want to constrain the
exact implemented algorithm, you can't do that in your tests.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4472] Is shared lib building broken on trunk for Mac OS X?

2008-12-31 Thread Skip Montanaro

Skip Montanaro s...@pobox.com added the comment:

The patch seemed to work for me.  Should I worry that I don't see
-fPIC or -fpic in the compile commands?  Also, running make test
before at least installing libpython2.7.dylib appears to be impossible:

% otool -L python.exe 
python.exe:
/Users/skip/local/lib/libpython2.7.dylib (compatibility version 
2.7.0, current version 2.7.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 111.1.3)
regular% ./python.exe 
dyld: Library not loaded: /Users/skip/local/lib/libpython2.7.dylib
  Referenced from: /Users/skip/src/python/trunk/regular/./python.exe
  Reason: image not found
Trace/BPT trap

Is there a way to work around that?

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4472
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib

2008-12-31 Thread Christopher Mahan

New submission from Christopher Mahan chris.ma...@gmail.com:

The python program crashes (stops responding) both from the command line
and in IDLE (ver 3.0), after listing all the files in the approprate
directory, both with ftp.dir() and with ftp.retrlines('LIST') (see prog
listing below).

I have to close the window (both window shell and IDLE). No other key
combo responds.


Python env (from IDLE):
Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win32

Program:

import ftplib

ftp = ftplib.FTP('ftp.edgecastcdn.net', user='theusername',
passwd='thepassword')
ftp.cwd('chrismahan-675')
ftp.dir()
#ftp.retrlines('LIST')
ftp.close()

The username and password are correct.
I am able to use the ftp resource with filezilla (3.1.6) with no problem.

This runs on a Windows Server 2003 Standard Edition, Service Pack 2.

This is also a completely clean install of Python 3.0. I installed it,
then wrote this program.

Python 2.5 is installed on this server and runs fine.

Any questions: chris.ma...@gmail.com

--
components: Extension Modules
messages: 78603
nosy: chris.mahan
severity: normal
status: open
title: retrlines('LIST') and dir hang at end of listing in ftplib
type: crash
versions: Python 3.0

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4791
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan

Changes by Christopher Mahan chris.ma...@gmail.com:


--
title: retrlines('LIST') and dir hang at end of listing in ftplib - 
retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4791
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan

Christopher Mahan chris.ma...@gmail.com added the comment:

Update: Ran the same code with python 2.6.1 on the same computer, and
that worked fine.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4791
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4539] askdirectory() in tkinter.filedialog is broken

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

I was about to mark this as invalid when I found out I had patched
tkinter/filedialog.py myself. Nevertheless, this is a duplicate of issue4406

--
nosy: +gpolo
resolution:  - duplicate
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4539
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4263] BufferedWriter non-blocking overage

2008-12-31 Thread Sever Băneșiu

Sever Băneșiu banesiu.se...@gmail.com added the comment:

 The comment is misleading because in fact no byte is written at raw
 level. That's because the data size is smaller than the buffer size and
 the buffer is empty (was emptied by the last write call).

 It depends on the implementation. A different implementation may use a
 different algorithm.

I feel that no matter what implementation algorithm BufferedWriter uses
it shouldn't write smaller chunks of data than buffer's size or else the
buffer is useless.

 I also think this is the
 correct behavior regardless of implementation language of BufferedWriter
 class i.e. no write call should write at raw level smaller chunks of
 data than buffer's size unless it has to.

 But how do you decide when it has to? Unless you want to constrain the
 exact implemented algorithm, you can't do that in your tests.

When a direct or indirect (e.g. on close) flush is called for the file
object.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4406] In Lib\tkinter\filedialog.py, class Directory define loss a_

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

I'm moving this to release blocker since it went unnoticed in the 3.0
release.

--
priority:  - release blocker

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4406
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4263] BufferedWriter non-blocking overage

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I feel that no matter what implementation algorithm BufferedWriter uses
 it shouldn't write smaller chunks of data than buffer's size or else the
 buffer is useless.

If you rewrite the above sentence using the word statistically, then I
can agree :)
But if I look at e.g. the fwrite() manpage, I see no guarantee that the
stdio layer will never make a call to write() with a size smaller than
the buffer size. The buffered layer should be free to manage its buffer
in what it believes is the most efficient way. The only guarantee is
that it won't buffer more than max_buffer_size.

Anyway :) Practically, the test does work on both py3k and another
implementation, so I don't see any urgency to remove anything from it.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4472] Is shared lib building broken on trunk for Mac OS X?

2008-12-31 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

Skip: 
* GCC always generates position-independent code on OSX

* I'll look in the test issue, that's probably caused by a broken 
definition for RUNSHARED.

Roumen:

* The SHLIB_EXT definition in pyconfig.h is an issue. And I have to 
agree that SO is meant to be the suffix for python extension, given 
the comment about LDSHARED in configure.in (just below the definition of 
SHLIB_EXT). 

I'll work on a different way to deal with the .dylib vs. .so problem.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4472
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4749] Issue with RotatingFileHandler logging handler on Windows

2008-12-31 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
assignee:  - vsajip
nosy: +vsajip

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4749
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4406] In Lib\tkinter\filedialog.py, class Directory define loss a_

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Fixed in r68103.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4406
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4786] xml.etree.ElementTree module name in Python 3

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

So let's close this as won't fix.

--
nosy: +benjamin.peterson
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4786
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4718] wsgiref package totally broken

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Philip, Graham, do you have any objections to the current patch?
Otherwise I think I'm gonna commit it soon.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4718
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4792] PythonCmd in Modules/_tkinter.c should use the given interp parameter

2008-12-31 Thread Guilherme Polo

New submission from Guilherme Polo ggp...@gmail.com:

Right now PythonCmd is using the Tcl interpreter stored in self-interp,
but this is unsafe and since it is a Tcl_CmdProc it already receives the
Tcl interpreter as a parameter. Using the interpreter in self-interp is
unsafe because Python might deallocate this TkappObject and then
PythonCmd could be invoked later, and using the interpreter given to the
Tcl_CmdProc is guaranteed to be safe by Tcl.

To reproduce this I needed a debug build and also needed to run the
example below in the interpreter:

 import tkFileDialog
 tkFileDialog.askdirectory() # here I both windows, then:
 Segmentation fault

There are other ways to reproduce this but I can't remember them
offhand, I know there are other ways because I've hit this same problem
in another python - tcl bridge by doing something else.

The patch could be expanded to remove the use of self in
PythonCmd_Clientdata, but given another wish I have -- to move to
Tcl_CreateObjCommand -- self would be needed again.

--
components: Tkinter
files: use_given_interp.diff
keywords: patch
messages: 78613
nosy: gpolo
severity: normal
status: open
title: PythonCmd in Modules/_tkinter.c should use the given interp parameter
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file12505/use_given_interp.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4747] SyntaxError executing a script containing non-ASCII characters in its name or path

2008-12-31 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This also happens if there is any kind of syntax error in the file: 
SyntaxError: None is printed without any other hint.

The (char*) filename passed to PyRun_AnyFile should be utf-8 encoded;
Otherwise the file cannot be re-opened.

Attached patch fixes both issues, please review.
It removes one occurrence of wcstombs in favor of the PyUnicode machinery.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
stage:  - patch review
Added file: http://bugs.python.org/file12506/unicode_scriptname.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4747
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
nosy: +christian.heimes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4772] undesired switch fall-through in socketmodule.c

2008-12-31 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

See attached patch.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
stage:  - patch review
versions: +Python 2.6, Python 3.0
Added file: http://bugs.python.org/file12507/bluetooth.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4772
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

I'm having trouble understanding the technique of the jump table. Can
you provide some links to papers that explain the threaded code? I'm
interested in learning more.
How does your implementation compare to the GForth based threaded code
speedwise?

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4747] SyntaxError executing a script containing non-ASCII characters in its name or path

2008-12-31 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I'm unable to reproduce the problem on Linux. I wrote a 
script /home/haypo/ééé/ééé.py:
---
#!/home/haypo/prog/SVN/py3k/python
# -*- coding: ascii -*-
print(a)
---

The script runs fine:
$ ./ééé.py
a
$ /home/haypo/prog/SVN/py3k/python ééé.py
a

Is the problem specific to Windows?

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4747
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Can you paste the expected result of ftp.retrlines('LIST')? Does a 
directory contains a non-ASCII character?

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4791
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I'm having trouble understanding the technique of the jump table. Can
 you provide some links to papers that explain the threaded code? I'm
 interested in learning more.

I haven't read any papers. Having a jump table in itself isn't special
(the compiler does exactly that when compiling the switch() statement).
What's special is that a dedicated indirect jump instruction at the end
of each opcode helps the CPU make a separate prediction for which opcode
follows the other one, which is not possible with a switch statement
where the jump instruction is shared by all opcodes. I believe that's
where most of the speedup comes from.

If you read the patch it will probably be easy to understand.

I had the idea to try this after a thread on pypy-dev, there are more
references there:
http://codespeak.net/pipermail/pypy-dev/2008q4/004916.html

 How does your implementation compare to the GForth based threaded code
 speedwise?

Don't know! Your experiments are welcome. My patch is far simpler to
integrate though (it's small, introduces very few changes and does not
break any existing tests).

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4747] SyntaxError executing a script containing non-ASCII characters in its name or path

2008-12-31 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Yes. As usual, the problem occurs when the platform encoding (used by
wcstombs) is not utf-8.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4747
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3638] tkinter.mainloop() is meaningless and crash: remove it

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

tkinter.mainloop seems used in a bunch of places according to Google
Code. Am I missing something?

http://www.google.com/codesearch?hl=frlr=q=%22tkinter.mainloop%22sbtn=Rechercher

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4732] Object allocation stress leads to segfault on RHEL

2008-12-31 Thread Andrew

Andrew fbsd...@gmail.com added the comment:

This problem appears to be specific to RHEL 5, and is not a Python
problem.  Linking against Google malloc (libtcmalloc) fixes the issue.

This bug should be closed.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4732
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4732] Object allocation stress leads to segfault on RHEL

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Ok, thanks for the investigation!

--
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4732
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3638] tkinter.mainloop() is meaningless and crash: remove it

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

On Wed, Dec 31, 2008 at 2:24 PM, Antoine Pitrou rep...@bugs.python.org wrote:

 Antoine Pitrou pit...@free.fr added the comment:

 tkinter.mainloop seems used in a bunch of places according to Google
 Code. Am I missing something?


Yes, those are not _tkinter.mainlooop, they are Tkinter.mainloop.

 http://www.google.com/codesearch?hl=frlr=q=%22tkinter.mainloop%22sbtn=Rechercher


___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3638] tkinter.mainloop() is meaningless and crash: remove it

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

On Wed, Dec 31, 2008 at 2:27 PM, Guilherme Polo rep...@bugs.python.org wrote:

 Guilherme Polo ggp...@gmail.com added the comment:

 On Wed, Dec 31, 2008 at 2:24 PM, Antoine Pitrou rep...@bugs.python.org 
 wrote:

 Antoine Pitrou pit...@free.fr added the comment:

 tkinter.mainloop seems used in a bunch of places according to Google
 Code. Am I missing something?


 Yes, those are not _tkinter.mainlooop, they are Tkinter.mainloop.


Or were you referring to my other comment about removing it from
Tkinter.py too ?

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3638] tkinter.mainloop() is meaningless and crash: remove it

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Well, well, sorry for the noise!

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

 I haven't read any papers. Having a jump table in itself isn't special
 (the compiler does exactly that when compiling the switch() statement).
 What's special is that a dedicated indirect jump instruction at the end
 of each opcode helps the CPU make a separate prediction for which opcode
 follows the other one, which is not possible with a switch statement
 where the jump instruction is shared by all opcodes. I believe that's
 where most of the speedup comes from.
 
 If you read the patch it will probably be easy to understand.

You are right. It's easier to understand after I've learned how the
opcode_targets table is working. Previously I didn't know that one can
store the address of a label in an array. Before I got it I wondered
where the pointers were defined. Is this a special GCC feature? I
haven't seen it before.

 Don't know! Your experiments are welcome. My patch is far simpler to
 integrate though (it's small, introduces very few changes and does not
 break any existing tests).

Yes, your patch is much smaller, less intrusive and easier to understand
with a little background in CS.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Is this a special GCC feature?

Yes, it is.
http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan

Christopher Mahan chris.ma...@gmail.com added the comment:

the output: just before the non-responsiveness:

-rwxrwxrwx   1 nobody   nogroup   3905538 Dec 29 09:51 Bronski Beat -
Why.mp3
-rwxrwxrwx   1 nobody   nogroup873966 Dec 28 13:53 test9.avi
-rwxrwxrwx   1 nobody   nogroup   2512653 Dec 29 08:28 test9_lg.wmv
-rwxrwxrwx   1 nobody   nogroup  6549 Dec 29 08:28 test9_lg.wmv.jpg
-rwxrwxrwx   1 nobody   nogroup   1788466 Dec 29 03:04 test9_med.flv
-rwxrwxrwx   1 nobody   nogroup  6394 Dec 29 03:04 test9_med.flv.jpg
-rwxrwxrwx   1 nobody   nogroup   1263041 Dec 28 13:53 test9_sm.flv
-rwxrwxrwx   1 nobody   nogroup  6465 Dec 28 13:53 test9_sm.flv.jpg

Added file: http://bugs.python.org/file12508/from_filezilla.png

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4791
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4508] distutils compiler not handling spaces in path to output/src files

2008-12-31 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Hi. I am not familiar with weave. Could you provide a small sample of
code that raises this issue. This way, I will be able to write the
standalone test we can integrate in distutils together with your fix.

--
assignee:  - tarek
nosy: +tarek
priority:  - normal

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4508
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan

Christopher Mahan chris.ma...@gmail.com added the comment:

Added file screenshot of filezilla view of the folder in question.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4791
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue734176] Make Tkinter.py's nametowidget work with cloned menu widgets

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

Eh.. old.
Anyway, I have made a patch against trunk now and it should work with
any nested level of cloned menus according to how tk names cloned menus.

--
nosy: +gpolo
versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 -Python 2.3
Added file: http://bugs.python.org/file12509/nametowidget_clonedmenus.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue734176
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1702551] distutils sdist does not exclude SVN/CVS files on Windows

2008-12-31 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

I have put this ticket in my pile.

I will write the test to demonstrate the problem and get back to your
patch proposal.

As Christian said, both separator should be taken care of under Windows,
so the final regexp will be slighly different.

Last, the trunk code has evolved a bit since your initial proposal, and
now includes other VCSs like Mercurial or Git.

--
assignee:  - tarek
nosy: +tarek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1702551
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

2008-12-31 Thread Christopher Mahan

Christopher Mahan chris.ma...@gmail.com added the comment:

The list does not seem to contain non-ascii characters.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4791
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue995925] method after() and afer_idle() are not thread save

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

This is not going to happen.
You should be protecting it yourself since this is a special case.

--
nosy: +gpolo
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue995925
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Skip Montanaro

Changes by Skip Montanaro s...@pobox.com:


--
nosy: +skip.montanaro

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2693] IDLE doesn't work with Tk 8.5

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

Closing as only r59654 was backported to release25-maint, so Tk 8.5 is
not fully supported by the standard Tkinter present in python 2.5.x

--
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2693
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2693] IDLE doesn't work with Tk 8.5 under python 2.5 and older

2008-12-31 Thread Guilherme Polo

Changes by Guilherme Polo ggp...@gmail.com:


--
title: IDLE  doesn't work with Tk 8.5 - IDLE  doesn't work with Tk 8.5 under 
python 2.5 and older

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2693
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2995] Idle, some Linuxes, cannot position Cursor by mouseclick

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

Can you retry making some small example that demonstrates the problem ?

--
nosy: +gpolo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2995
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2638] tkSimpleDialog Window Flashing

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

Dropped for inclusion in python 2.5, but should still be considered for
trunk and py3k.

--
resolution:  - accepted
versions: +Python 2.7, Python 3.0, Python 3.1 -Python 2.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2638
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2734] 2to3 converts long(itude) argument to int

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

I hope r68106 helps. 2to3 now refuses to change long if it is being
assigned to, the name of a function or class, the name of an argument,
or an attribute.

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2734
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3260] fix_imports does not handle intra-package renames

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

I think I will close this as won't fix. As you say, the only
applicable rename is test.test_support. That only is not enough IMO to
add all the complexity to fix_imports that handling packages properly
would require.

--
nosy: +benjamin.peterson
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3260
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4793] Glossary incorrectly describes a decorator as merely syntactic sugar

2008-12-31 Thread Lenard Lindstrom

New submission from Lenard Lindstrom le...@telus.net:

http://www.python.org/doc/2.6/glossary.html

The decorator entry in the Python 2.6 documentation incorrectly
describes a decorator as merely syntactic sugar. It is not, as this
example shows:

 def decorator(f):
f.prev = globals()[f.__name__]
return f

 func = 0
 def func():
pass

 func = decorator(func)
 func.prev
function func at 0x00C748F0
 func = 0
 @decorator
def func():
pass

 func.prev
0

This distinction could be useful in building multi-methods, for example.

--
assignee: georg.brandl
components: Documentation
messages: 78643
nosy: georg.brandl, kermode
severity: normal
status: open
title: Glossary incorrectly describes a decorator as merely syntactic sugar
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4793
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4793] Glossary incorrectly describes a decorator as merely syntactic sugar

2008-12-31 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

Your example doesn't disprove the merely syntactic sugar found in the
documentation about the decorator syntax.

The results you are getting are based on when the decorator is applied.

--
nosy: +gpolo
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4793
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2827] IDLE 3.0a5 cannot handle UTF-8

2008-12-31 Thread Pavel Kosina

Pavel Kosina g...@post.cz added the comment:

the following very simple example might be the the same issue:

x=ěščřžýáíé
print (x)

It reliably puts down IDLE entirely without any error message. It is
saved in UTF-8. 
python +idle 3.0, wxp sp3

--
nosy: +geon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2827
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects

2008-12-31 Thread darrenr

New submission from darrenr python-roun...@dranalli.com:

Python's garbage collector holds GIL during collection and doesn't
provide any method of interruption or concurrency with other Python
threads within a single Python VM. This can be a problem for realtime
applications. The worst-case performance of the garbage collector takes
linear time with respect to the number of Python objects that could
potentially be involved in a garbage cycle. I've attached timings taken
on a Core 2 Quad 2.4 GHz (WinXP Pro, 3GB RAM), with ever-increasing
numbers of objects. The gc at worst takes upwards of 3 seconds before
the process runs out of memory.

If gc periodically released the GIL it would allow it to be put in a
separate thread, but as it stands it blocks the Python VM for periods of
time that are too long for realtime interactive applications.
Alternatively a gc that is incremental by default would eliminate the
need for a second thread.

--
files: gctimings.zip
messages: 78646
nosy: darrenr
severity: normal
status: open
title: garbage collector blocks and takes worst-case linear time wrt number of 
objects
versions: Python 2.4, Python 2.6, Python 3.0
Added file: http://bugs.python.org/file12510/gctimings.zip

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4794
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects

2008-12-31 Thread darrenr

Changes by darrenr python-roun...@dranalli.com:


--
components: +Interpreter Core
type:  - resource usage

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4794
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4793] Glossary incorrectly describes a decorator as merely syntactic sugar

2008-12-31 Thread Lenard Lindstrom

Lenard Lindstrom le...@telus.net added the comment:

It is distinct behavior. Without a decorator a new function is
immediately assigned to the identifier. Any previous reference is lost.
A decorator postpones assignment until the decorator returns. That
allows the decorator to access the previous object. I don't know of any
way to do the same thing with:

def foo():
   .
foo = do_something(foo)

Here is part of a comp.lang.python thread discussing the possibility of
using a decorator for an overloaded function.

http://groups.google.com/group/comp.lang.python/browse_thread/thread/16a2e8b9d6705dfb/1cb0b358173daf06?lnk=gstq=Lenard+Lindstrom+decorator#1cb0b358173daf06

Note that the decorator could create an overloaded function without any
extra variables. To do the equivalent in Python 2.3 a special attribute,
with a mangled name, was needed to store intermediate declarations.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4793
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects

2008-12-31 Thread David W. Lambert

Changes by David W. Lambert lamber...@corning.com:


--
nosy: +LambertDW

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4794
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4793] Glossary incorrectly describes a decorator as merely syntactic sugar

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

It is possible to desugar the exact behavior by creating the function
ones self.

Regardless, the usefulness this behavior is limited because it relys on
the decorator being in the same module as the function. It is also
fragile for nested functions.

--
nosy: +benjamin.peterson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4793
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

The garbage collector will never be able to run in a second thread
because it manipulates Python objects, which the GIL is supposed to protect!

As for non-linear complexity, see #4688 and #4074 for some attempts to
sooth this problem over.

--
nosy: +benjamin.peterson
resolution:  - duplicate
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4794
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4747] SyntaxError executing a script containing non-ASCII characters in its name or path

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Looks good.

--
keywords:  -needs review
nosy: +benjamin.peterson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4747
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

This new patch adds some detailed comments, at Jason Orendorff's request.

Added file: http://bugs.python.org/file12511/threadedceval3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4793] Glossary incorrectly describes a decorator as merely syntactic sugar

2008-12-31 Thread Lenard Lindstrom

Lenard Lindstrom le...@telus.net added the comment:

The claim merely syntactic sugar implies that the inverse is also
true, the decorator expression:

@do_something
def foo():


can be replaced it with:

def foo():

foo = do_something(foo)

This is guaranteed if do_something is purely functional, but breaks if
do_something has side effects. The example was for illustration only. A
real application would likely access the parent frame. Whether or not
this is a questionable practice, it happens.

However, the issue is one of definitions. Is the phrase merely
syntactic sugar misleading? In this case it makes promises that may not
be kept.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4793
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

You may want to check out issue1408710 in which a similar patch was
provided, but failed to deliver the desired results.

I didn't get the advertised ~15% speed-up, but only 4% on my Intel Core2
laptop and 8% on my AMD Athlon64 X2 desktop. I attached the benchmark
results.

The patch looks pretty clean. Here is a few things that caught my
attention while reading your patch.

First, you should rename opcode_targets.c to opcode_targets.h. This will
make it explicit that the file is not compiled, but just included.

Also, the macro USE_THREADED_CODE should be renamed to something else;
the word thread is too tightly associated with multi-threading.
Furthermore, threaded code simply refers to code consisting only of
function calls. Maybe, USE_COMPUTED_GOTO or USE_DIRECT_DISPATCH would be
better.

Finally, why do you disable your patch when DYNAMIC_EXECUTION_PROFILE or
LLTRACE is enabled? I tested your patch with both enabled and I didn't
see any test failures.

By the way, SUNCC also supports GCC's syntax for labels as values
(http://docs.sun.com/app/docs/doc/819-5265/bjabt?l=ena=view).

--
nosy: +alexandre.vassalotti
Added file: http://bugs.python.org/file12512/amd-athlon64-x2-pybench.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Added file: http://bugs.python.org/file12513/intel-core2-mobile-pybench.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4790] Optimization to heapq module

2008-12-31 Thread Nilton Volpato

Nilton Volpato nil...@google.com added the comment:

Nice!

Maybe we could add the decorate/undecorate step to guarantee stability
to the C implementation. I'll do some experiments and timings on this.
The heapq library has a lot of room for optimization, I think.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4790
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Skip Montanaro

Skip Montanaro s...@pobox.com added the comment:

Works pretty well for me on my MacBook Pro, but on my G5 it performed
abysmally.  In fact, it ran so much worse that I cleaned up my sandbox 
and did both checks all over again to make sure I didn't mess something
up.  It looks like my MacBook Pro saw about a 14% degradation.  Both
computers are running Mac OS X 10.5.6 with the latest Xcode - 3.1.2.
On both computers gcc -v reports 4.0.1, Apple build 5490.

If this is applied to the core I think it will have to select for more
than just gcc.  It will also have to select based on the chip
architecture.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Skip Montanaro

Changes by Skip Montanaro s...@pobox.com:


___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Skip Montanaro

Skip Montanaro s...@pobox.com added the comment:

Works pretty well for me on my MacBook Pro, but on my G5 it performed
abysmally.  In fact, it ran so much worse that I cleaned up my sandbox 
and did both checks all over again to make sure I didn't mess something
up.  It looks like my MacBook Pro saw about a 7% improvement while my
G5 saw a 14% degradation.  Both computers are running Mac OS X 10.5.6
with the latest Xcode - 3.1.2.  On both computers gcc -v reports 4.0.1,
Apple build 5490.

If this is applied to the core I think it will have to select for more
than just gcc.  It will also have to select based on the instruction set
architecture.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Works pretty well for me on my MacBook Pro, but on my G5 it performed
 abysmally.  In fact, it ran so much worse that I cleaned up my sandbox 
 and did both checks all over again to make sure I didn't mess something
 up.  It looks like my MacBook Pro saw about a 14% degradation.  Both
 computers are running Mac OS X 10.5.6 with the latest Xcode - 3.1.2.
 On both computers gcc -v reports 4.0.1, Apple build 5490.

You're sure you didn't compile in debug mode or something? Just
checking.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Skip Montanaro

Skip Montanaro s...@pobox.com added the comment:

Antoine You're sure you didn't compile in debug mode or something? Just
Antoine checking.

There was a cut-n-paste error in that one which I noticed right after
submitting (man, do I hate the crappy editing capability of textarea
widgets).  I removed it within a minute or two and replaced it with a
correct version.  Short answer: Intel thumbs up, PowerPC thumbs down.

Skip

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4793] Glossary incorrectly describes a decorator as merely syntactic sugar

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

On Wed, Dec 31, 2008 at 3:17 PM, Lenard Lindstrom
rep...@bugs.python.org wrote:

 However, the issue is one of definitions. Is the phrase merely
 syntactic sugar misleading? In this case it makes promises that may not
 be kept.

It's not misleading because in 99.99% of all cases (and 100% of all
reasonable ones), they are the same. In fact, I would classify the
fact that the function hasn't been assigned yet a implementation
detail.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4793
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Hello,

 You may want to check out issue1408710 in which a similar patch was
 provided, but failed to deliver the desired results.
 
 I didn't get the advertised ~15% speed-up, but only 4% on my Intel Core2
 laptop and 8% on my AMD Athlon64 X2 desktop. I attached the benchmark
 results.

Thanks. The machine I got the 15% speedup on is in 64-bit mode with gcc
4.3.2.

If you want to investigate, you can output the assembler code for
ceval.c; the command-line should be something like:

gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -S -dA 
Python/ceval.c

and then count the number of indirect jump instructions in ceval.c:

grep -E jmp[[:space:]]\*% ceval.s

There should be 85 to 90 of them, roughly. If there are many less, then
the compiler has tried to optimize them by sharing them.

 First, you should rename opcode_targets.c to opcode_targets.h. This will
 make it explicit that the file is not compiled, but just included.

Ok.

 Also, the macro USE_THREADED_CODE should be renamed to something else;
 the word thread is too tightly associated with multi-threading.
 Furthermore, threaded code simply refers to code consisting only of
 function calls. Maybe, USE_COMPUTED_GOTO or USE_DIRECT_DISPATCH would be
 better.

Ok.

 Finally, why do you disable your patch when DYNAMIC_EXECUTION_PROFILE or
 LLTRACE is enabled? I tested your patch with both enabled and I didn't
 see any test failures.

Because otherwise the measurements these options are meant to do would
be meaningless.

 By the way, SUNCC also supports GCC's syntax for labels as values

I don't have a Sun machine to test, so I'll leave to someone else to
check and enable if they want to.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions

2008-12-31 Thread Steven D'Aprano

New submission from Steven D'Aprano st...@pearwood.info:

The inspect isSOMETHING() functions all return True or False, except 
for isgeneratorfunction(), which returns True or None.

The body of the function is very brief:

if (isfunction(object) or ismethod(object)) and \
object.func_code.co_flags  CO_GENERATOR:
return True

The behaviour can be made consistent with the other routines by either 
appending else: return False, or changing the body to:

return bool(
  (isfunction(object) or ismethod(object)) and
   object.func_code.co_flags  CO_GENERATOR)

--
components: Library (Lib)
messages: 78661
nosy: stevenjd
severity: normal
status: open
title: inspect.isgeneratorfunction inconsistent with other inspect functions
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4794] garbage collector blocks and takes worst-case linear time wrt number of objects

2008-12-31 Thread darrenr

darrenr python-roun...@dranalli.com added the comment:

A 'stop-the-world' garbage collector that periodically released the GIL
could be run in a second thread, allowing the main thread to break in
and do some processing. However the nature of a stop-the-world collector
means that it probably would not easily be able to deal with changes
made by other threads in the middle of the collect.

My concern is that the Python process blocks and is unresponsive due to
garbage collection for periods of time that are not acceptable for
realtime interactive applications. Are there any plans to add an
incremental collector to Python?

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4794
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Attached new patch for fixes suggested by Alexandre (rename
opcode_targets.c to opcode_targets.h, replace USE_THREADED_CODE with
USE_COMPUTED_GOTOS).

Added file: http://bugs.python.org/file12514/threadedceval4.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4796] Decimal to receive from_float method

2008-12-31 Thread Steven D'Aprano

New submission from Steven D'Aprano st...@pearwood.info:

In the PEP for Decimal, it was discussed that the class should have a 
from_float() method for converting from floats, but to leave it out of 
the Python 2.4 version:
http://www.python.org/dev/peps/pep-0327/#from-float

Following discussions with Mark Dickinson, I would like to request 
that this now be implemented.

The suggested API is:
Decimal.from_float(floatNumber, [decimal_places])

At the risk of derailing the request, I wonder whether it is better to 
give a context rather than a number of decimal places?

Pro: better control over conversion, as you can specify rounding 
method as well as number of decimal places.

Con: more difficult for newbies to understand.

Semi-pro: float to decimal conversions are inherently tricky, perhaps 
we should be discouraging newbies from blindly calling from_float() 
and make the (hypothetical) context argument mandatory rather than 
optional?

--
components: Library (Lib)
messages: 78664
nosy: stevenjd
severity: normal
status: open
title: Decimal to receive from_float method
type: feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4796
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


Removed file: http://bugs.python.org/file12511/threadedceval3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


Removed file: http://bugs.python.org/file12474/threadedceval2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4796] Decimal to receive from_float method

2008-12-31 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
assignee:  - rhettinger
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4796
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4751] Patch for better thread support in hashlib

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Based on quick testing on my computer, we could probably put the limit
as low as 1KB. But it may be that locks are cheap under Linux.
In any case, the patch looks good, but I'm no OpenSSL expert.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4751
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3959] Add Google's ipaddr.py to the stdlib

2008-12-31 Thread David Moss

David Moss drk...@gmail.com added the comment:

I think this might be worth a look before any hard and fast decisions
are made :-

http://code.google.com/p/netaddr/

--
nosy: +drkjam

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3023] Problem with invalidly-encoded command-line arguments (Unix)

2008-12-31 Thread Gabriel Genellina

Changes by Gabriel Genellina gagsl-...@yahoo.com.ar:


--
nosy: +gagenellina

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3023
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions

2008-12-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Fixed in r68112.

--
nosy: +benjamin.peterson
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4751] Patch for better thread support in hashlib

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Actually, your code can deadlock since ENTER_HASHLIB doesn't release the
GIL. Think about it:

// Thread A is here, holding the GIL and waiting for self-lock to be 
// released by thread B
ENTER_HASHLIB(self)
Py_BEGIN_ALLOW_THREADS
// Thread B is here, holding self-lock and waiting for the GIL to be
// released by thread A
Py_END_ALLOW_THREADS
LEAVE_HASHLIB(self)

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4751
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4796] Decimal to receive from_float method

2008-12-31 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

The decimal constructor should be lossless.  The underlying spec was
designed with the notion that all numbers in decimal are exact;
operations can be lossy but the numbers themselves are exact. 
Accordingly, I recommend Decimal.from_float(f) with no qualifiers or
optional arguments.

To support the use case of wanting to round the input, I suggest a
separate method modeled on Context.create_decimal().  It can either be
an extension of the existing method or a new method like
Context.create_decimal_from_float().  I recommend the former since
rounding is already implied by the context qualifier.  Either way, the
effect would be the same as Decimal.from_float(f) + 0 in a given
context.  Per the docs:  Creates a new Decimal instance from num but
using self as context. Unlike the Decimal constructor, the context
precision, rounding method, flags, and traps are applied to the conversion.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4796
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4796] Decimal to receive from_float method

2008-12-31 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

FYI, there is already a lossless implementation in the docs:

def float_to_decimal(f):
Convert a floating point number to a Decimal with no loss of
information
n, d = f.as_integer_ratio()
with localcontext() as ctx:
ctx.traps[Inexact] = True
while True:
try:
   return Decimal(n) / Decimal(d)
except Inexact:
ctx.prec += 1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4796
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4781] The function, Threading.Timer.run(), may be Inappropriate

2008-12-31 Thread Gabriel Genellina

Gabriel Genellina gagsl-...@yahoo.com.ar added the comment:

Note that doing this would change the class semantics.
Timer [...] represents an action that should be run only after a 
certain amount of time has passed — a timer. and the example clearly 
shows that the action is run *once*. 

Timer is basically an example of how to write custom Thread 
subclasses; if you want a repetitive action, you may easily write a 
subclass based on the code you posted. Not every useful class must be 
in the standard library...

--
nosy: +gagenellina

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4781
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3959] Add Google's ipaddr.py to the stdlib

2008-12-31 Thread pmoody

pmoody pyt...@hda3.com added the comment:

I'm biased ;) but I don't see what netaddr provides over ipaddr.  it
also seems to be in the neighborhood of 50% slower (at least on my mac
mini).

pmo...@mini - 04:52 PM - ~/Downloads/ipaddr-1.0.1
- python -m timeit 'import ipaddr;\
ipaddr.IP(1.1.1.1)'
1 loops, best of 3: 46.2 usec per loop

pmo...@mini - 04:52 PM - ~/Downloads/netaddr-0.5.2
- python -m timeit 'import netaddr;\
netaddr.IP(1.1.1.1)'
1 loops, best of 3: 71.9 usec per loop

dealing with netmasks, the difference is even greater.
pmo...@mini - 04:52 PM - ~/Downloads/ipaddr-1.0.1
- python -m timeit 'import ipaddr;\
ipaddr.IP(1.1.1.1/255.255.255.0)'
1 loops, best of 3: 78.4 usec per loop

pmo...@mini - 04:49 PM - ~/Downloads/netaddr-0.5.2
- python -m timeit 'import netaddr;\
 netaddr.IP(1.1.1.1/255.255.255.0)'
1000 loops, best of 3: 247 usec per loop

(and it doesn't seem to deal with hostsmasked addresses).

it also seems to be layed out in an unintuitive way, treating address
ranges a something very different than network addresses. hopefully
someone who isn't intimately familiar with both libraries can comment,
but ipaddr feels a lot cleaner to me.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions

2008-12-31 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

This can be simplified to just:

return (isfunction(object) or ismethod(object)) and \
 object.func_code.co_flags  CO_GENERATOR

No need for patterns like:

  if cond:
 return True
  return False

--
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4795
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3959] Add Google's ipaddr.py to the stdlib

2008-12-31 Thread Jean-Paul Calderone

Jean-Paul Calderone exar...@divmod.com added the comment:

Performance shouldn't be a major concern here.  Utility is more
important and the implementation can be optimized later.

My initial impression of netaddr is pretty good.  One thing it has going
for it is documentation.  The netaddr google page gives a really great
overview of the functionality provided.  In comparison, the ipaddr-py
page is extremely sparse; the documentation in the repository is no
better (as there isn't really any).

There are a lot of minor things about ipaddr-py which are off-putting. 
It uses a naming convention that's not like any real Python software I'm
familiar with.  In particular, CamelCase method names really draw the
eye (in a bad way) and distract from the actual functionality being
provided.  I assume that if ipaddr-py is selected for inclusion, the API
will be adapted to fit PEP 8.  In comparison, netaddr appears to largely
comply with PEP 8 already.

Regarding the treatment of addresses versus address ranges, I prefer
netaddr's solution.  An address is not the same as an address range.  It
seems odd to try to represent them both with the same type as ipaddr-py
does.  This feels somewhat APLesque (where everything is a vector),
which isn't bad in itself, but generally if I want to manipulate an IP
address, I'm not thinking about it as a list of one address.  If I
wanted to do that, then I'd make a list and put the address in it.  By
comparison, the separate CIDR type in netaddr makes a lot of sense.  It
preserves a memory-efficient representation of the address range, but
does it with a different type than the fundamental address type.

This is far from a complete review of either library, obviously.  I've
done little more than glance over the documentation of each and do a
small amount of interactive playing around.  A lot more effort seems to
have gone into making netaddr accessible and appealing, and I think it
has succeeded.  Perhaps if some documentation for ipaddr-py is written
it will be easier to see where that library excels.  Of course, I assume
this is a prerequisite for inclusion in the standard library as well.

--
nosy: +exarkun

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1664] nntplib is not IPv6-capable

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I was going to suggest writing a test but I see that nntplib hasn't got
a single unit test :-O

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3959] Add Google's ipaddr.py to the stdlib

2008-12-31 Thread pmoody

pmoody pyt...@hda3.com added the comment:

hm, all addresses have a subnet, even if its an implied /32, so
specifying a network as (1.1.1.0, 1.1.1.255) seems a lot more
off-putting than 1.1.1.0/24. You're also much more likely to see the
latter in network devices. I guess I don't see the utility in an address
range of .1 - .22 (or something arbitrary, something which doesn't fall
on a power-of-2 boundary); when dealing with ranges of addresses, i've
always only wanted to/needed to manipulate sub-networks of addresses.

and my expectation was always that method names, etc. would have to be
converted to more closely match other python code; ipaddr was written to
google's python style guide, which I understand can be different than
the python.org style guide ;)

also, ipaddr does make extensive use of pydoc, but you're right, the
webpage is spartan.

happy (PST) new year.

Cheers,
/peter

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4572] add SEEK_* values to io and/or io.IOBase

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Sounds like a nice improvement.

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4572
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4272] set timestamp in gzip stream

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

test_literal_output looks really too strict to me. At most, you could
check that the header and trailer are unchanged, but it would probably
make it equivalent to test_metadata.
Other than that, I think it's an useful addition.

--
nosy: +pitrou
priority:  - normal
stage:  - patch review
versions: +Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4272
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3959] Add Google's ipaddr.py to the stdlib

2008-12-31 Thread Jean-Paul Calderone

Jean-Paul Calderone exar...@divmod.com added the comment:

 hm, all addresses have a subnet, even if its an implied /32, so
specifying a network as (1.1.1.0, 1.1.1.255) seems a lot more
off-putting than 1.1.1.0/24. You're also much more likely to see the
latter in network devices.

I'm not sure which API in netaddr you're referring to.  If you want to
construct that /24 with netaddr, then I would use
netaddr.address.CIDR(1.1.1.0/24).  Offhand, I can't find an API which
accepts two endpoints of a range to construct a network in netaddr. 
When I wrote about having separate types for individual addresses vs
ranges of addresses in my previous comment, I had IP and CIDR
respectively in mind, as opposed to ipaddr-py's single IPv4 class which
can represent either.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3959
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4035] Support bytes for os.exec*()

2008-12-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Hmm, I think the supported types should be the same for all platforms,
otherwise it creates unnecessary headaches.

Perhaps, in addition to the proposed behaviour on Posix (convert
everything to bytes if the program name is a bytes object), the reverse
could be done under Windows (convert the program name to str if it is a
bytes object).

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4035
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >