[issue5739] Language reference is ambiguous regarding next() method lookup

2009-04-18 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

I was surprised when this came up with another issue.
Why does  CPython behave that way?  Accident or justified decision?

--
nosy: +tjreedy

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



[issue5760] __getitem__ error message hard to understand

2009-04-18 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

As I said on the python-ideas discussion, which definitely did *not*
come to consensus, I disagree with this suggestion.  To repeat and
expand on what I said there:

1. 'unsubscriptable' could instead be changed to 'not subscriptable'.

2. 'subscription' *is* the way Python describes the use of [].
A subscription selects an item of a sequence (string, tuple or list)
or mapping (dictionary) object:

subscription ::=  primary [ expression_list ]

'array subscript' (from C, for example) is a standard term used for
decades in computer languages.  It is appropriate since a[i] is one
standard single-text-line replacement for atypographic subscripti when
one cannot actually 'type' a subscript.  It *is* a way of representing a
subscript, just as i**j is an in-line way of representing a superscript
exponent, which we still call an exponent in spite of it not being
'raised'.  Both constitute visible markup that is part of the compromise
in representing 2D typography with a 1D stream of characters.  Using '/'
for division (and fractions) is another.

3. Python error message generally do not and I think should not mention
the special method implementation that underlies surface level errors. 
In this particular case, the remedy to mistakenly trying to subscript
something is to not do that.  I think mentioning __getitem__ would be a
distraction.  One generally *cannot* just go around adding it.

--
nosy: +tjreedy

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



[issue5777] unable to search in python V3 documentation

2009-04-18 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

You should have searched for sys argv since sys.argv is not 'a
word'.  However, that would not have worked since multiple word
searching seems to be broken, at least sometimes.  In particular,
searching for 'argv' gives several hits, including the one you wanted,
as does searching for 'sys', but 'sys argv' does not.  I tried another
example using two words from a particular doc and got a similar failure.

--
nosy: +tjreedy

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



[issue5734] Fix BufferedRWPair

2009-04-18 Thread Brian Quinlan

Brian Quinlan br...@sweetapp.com added the comment:

http://codereview.appspot.com/40126/diff/1/2
File Lib/_pyio.py (left):

http://codereview.appspot.com/40126/diff/1/2#oldcode370
Line 370: def _checkReadable(self, msg=None):
On 2009/04/17 21:11:15, Antoine Pitrou wrote:
 Not sure why you're removing it. Currently it's used in Lib/socket.py.

I didn't see the other usages. I removed it because it was only used
twice in this file and one of the usages involved an instance other than
self i.e. calling an internal method on another instance. Ditto for
_checkWriteable

Now restored.

http://codereview.appspot.com/40126/diff/1/3
File Lib/test/test_io.py (right):

http://codereview.appspot.com/40126/diff/1/3#newcode1121
Line 1121: self.assertTrue(pair.readable)
On 2009/04/17 21:11:15, Antoine Pitrou wrote:
 This is probably `pair.readable()` and not `pair.readable`.

Done.

http://codereview.appspot.com/40126/diff/1/3#newcode1125
Line 1125: self.assertTrue(pair.writable)
On 2009/04/17 21:11:15, Antoine Pitrou wrote:
 Same comment as for readable above.

Done.

http://codereview.appspot.com/40126/diff/1/3#newcode1126
Line 1126:
On 2009/04/17 21:11:15, Antoine Pitrou wrote:
 There should probably be a test for seekable() as well.

Now you are getting greedy. Done.

http://codereview.appspot.com/40126/diff/1/4
File Modules/_io/bufferedio.c (right):

http://codereview.appspot.com/40126/diff/1/4#newcode1876
Line 1876: Py_DECREF(self-reader);
On 2009/04/17 21:11:15, Antoine Pitrou wrote:
 You must use Py_CLEAR so that there is no double free when calling
 BufferedRWPair_dealloc().

Done.

http://codereview.appspot.com/40126

--

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



[issue5777] unable to search in python V3 documentation

2009-04-18 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Thanks for the report, searching for dotted identifiers is implemented
now in the trunk version of Sphinx.

--
resolution:  - fixed
status: open - closed

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



[issue3102] ctypes defines global symbols

2009-04-18 Thread Thomas Heller

Thomas Heller thel...@ctypes.org added the comment:

Correction: The patch has 3000 lines, not 300.

And I think that the 'My_Unicode_...' functions can be removed because
they are not used anywhere.  I have to check this.

--

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



[issue5760] __getitem__ error message hard to understand

2009-04-18 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I concur. I changed unsubscriptable to not subscriptable in r71696.

--
nosy: +georg.brandl
resolution:  - fixed
status: open - closed

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-18 Thread Trundle

Trundle andysmu...@hammerhartes.de added the comment:

The problem is that `type_setattro()` sets the new __new__ attribute
in the type's dict (through `PyObject_GenericSetAttr()`), but the
corresponding slot will never be updated if the new __new__ is a
PyCFunction.

The affected code in `update_one_slot()` was added by Guido van Rossum
in r28090, so maybe he would like to comment on that.

--

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



[issue5781] Legacy float repr is used unnecessarily on some platforms

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Fixed in r71698.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue5739] Language reference is ambiguous regarding next() method lookup

2009-04-18 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Guido didn't actually say whether or not this was originally just an
implementation accident or a deliberate design choice - he just
indicated that this was a case where caching the bound method should be
disallowed because it could change the semantics of existing programs.

--

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



[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Fixed in py3k in r71701.

Some of this fix can be backported to 2.7.

--
versions:  -Python 3.1

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



[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Closing this.  I think 2.7 is fine as it is.

--
resolution:  - fixed
status: open - closed

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



[issue1944] Documentation for PyUnicode_AsString (et al.) missing.

2009-04-18 Thread Lorenz Quack

Lorenz Quack d...@amberfisharts.com added the comment:

In addition to the above mentioned functions I found these to be
undocumented:

  PyUnicode_DecodeUTF7
  PyUnicode_DecodeUTF7Stateful
  PyUnicode_EncodeDecimal
  PyUnicode_EncodeUTF7
  PyUnicode_FromFormat
  PyUnicode_FromString
  PyUnicode_FromStringAndSize
  PyUnicode_GetMax
  PyUnicode_Partition
  PyUnicode_RPartition
  PyUnicode_RSplit

From the original list the following functions seem to have been removed:

  PyUnicode_InternImmortal
  PyUnicode_DecodeFSDefault
  PyUnicode_DecodeFSDefaultAndSize


I try to put together a patch for some of these during the weekend.

--
nosy: +donlorenzo
versions: +Python 2.6, Python 2.7, Python 3.1

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



[issue1869] Builtin round function is sometimes inaccurate for floats

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I take that back.  The 2.7 round still has some problems.
Here's one example:

 x = 5e15 + 1  # exactly representable as an IEEE 754 double
 x
5001.0
 round(x)
5002.0

Another nit:

 round(-0.0, 0)  # should retain the sign of zero
0.0

Reopening.

--
resolution: fixed - 
status: closed - open

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



[issue5785] Condition.wait() does not respect its timeout

2009-04-18 Thread Stéphane

New submission from Stéphane stephane.bisin...@gmail.com:

I have an issue with the wait() method of Condition which doesn't seem 
to respect the timeout it is given: I couldn't create a simple example 
to reproduce the bug, because if I try to do something small and simple 
everything works as expected, but in the actual code it doesn't work, 
so here's the link to the code:

http://github.com/Kjir/amsn2/blob/
bda6829d0c7d50a1cbf1188cdfa3789c4b7967c5/amsn2/gui/front_ends/curses/
contact_list.py

The most interesting function is the last one, where there is a wait 
with timeout of 1 second. If I have a look at the logs, after the 
initial download of the list there is nothing happening, while I'd 
expect to see a check cycle every second or so. If there is a 
notification arriving, the whole thing fires up and updates the contact 
list as expected, but the timeout itself doesn't work.

I don't know if there could be a problem with other modules, for 
instance gobject, but if there is then you should update the 
documentation to point out such incompatibilities.

If you could help me to create a simpler program to test this issue I 
would happy to provide you a test case, but I am out of ideas right now 
on how to narrow down the issue.

If you want to download the code and test it, here are the instructions:
git clone git://github.com/Kjir/amsn2.git
cd amsn2
git checkout -b curses_cl origin/curs_cl
python amsn2.py -f curses 2 run.log
Log in with an msn account, tail -f run.log in another terminal to 
watch the logs

If you want to se what happens on a notify, one of your contacts should 
change status.

And here are a very brief explanation on how the code is called, if you 
need it:
the whole code is divided in basically three areas, core, protocol and 
gui. I am working on the gui side and the methods contactListUpdated, 
groupUpdated and contactUpdated are called by the core through a 
gobject signal.

My python version is 2.5.2 on gentoo amd64, use flags:
berkdb gdbm ipv6 ncurses readline ssl threads tk xml
-build -doc -elibc_uclibc -examples -sqlite -ucs2 -wininst

If you need anything else, just ask!

Oh and here's the link to the posts on comp.lang.python:
http://groups.google.com/group/comp.lang.python/browse_thread/
thread/7fc388c30304bf22#

--
components: Library (Lib)
messages: 86118
nosy: Kjir
severity: normal
status: open
title: Condition.wait() does not respect its timeout
type: behavior
versions: Python 2.5

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



[issue1538691] Patch cElementTree to export CurrentLineNumber

2009-04-18 Thread Robin Bryce

Robin Bryce robinbr...@gmail.com added the comment:

 In the upstream 1.0.6, the ParseError exception has a position attribute
 that contains a (line, column) tuple.

That's fine for errors in the xml domain. Its not enough if I'm
reporting errors in the application domain - where I wont have a handy
exception to interrogate. What's the problem with just exposing the api
and requiring users who need it to use the streaming parser ?

Personally, I would have cached these details as a properties of the
_ElementInterface implementation for precisely this use case.

--
nosy: +robinbryce
status: pending - open

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



[issue1944] Documentation for PyUnicode_AsString (et al.) missing.

2009-04-18 Thread Lorenz Quack

Lorenz Quack d...@amberfisharts.com added the comment:

Ok, here is my shot at a patch for at least some of the undocumented
functions. Namely the following functions are being documented in the patch:

  PyUnicode_FromFormat
  PyUnicode_FromFormatV
  PyUnicode_FromString
  PyUnicode_FromStringAndSize
  PyUnicode_Partition
  PyUnicode_RPartition
  PyUnicode_RSplit

Please thoroughly review this patch since I didn't really digg into the
source to find out what the functions do but rather just copied old
PyString documentation or derived it from the docs for the Python API.

--
keywords: +patch
Added file: http://bugs.python.org/file13717/unicode.patch

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



[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread seesee

New submission from seesee cthe...@gmail.com:

It seems python 2.6.2 (at least under Windows, I have not tested other
platforms) does break the len function on the reversed iterator:

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on
win32
Type help, copyright, credits or license for more information.
 len(reversed([1,2,3]))
3

Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
(Intel)] on
win32
Type help, copyright, credits or license for more information.
 len(reversed([1,2,3]))
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: object of type 'listreverseiterator' has no len()

I don't think it was meant to work but it did in Python 2.6.1 (and 2.5
as shown above). I guess it has something to do with Issue #3689 and
guess __len__ was simply removed. 

Problem really is that Python 2.6.2 breaks backwards compatibility.

--
components: Windows
messages: 86122
nosy: seesee
severity: normal
status: open
title: len(reversed([1,2,3])) does not work anymore in 2.6.2
versions: Python 2.6

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



[issue2531] float compared to decimal is silently incorrect.

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Unassigning myself.

Does anyone beside Raymond and me have strong opinions about how/whether 
this problem should be fixed?

--

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



[issue2531] float compared to decimal is silently incorrect.

2009-04-18 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
assignee: marketdickinson - 

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



[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Martin v. Löwis

Changes by Martin v. Löwis mar...@v.loewis.de:


--
components:  -Windows

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



[issue5410] msvcrt bytes cleanup

2009-04-18 Thread STINNER Victor

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

 I cannot see any remarks about masking behavior. :-(

I asked on a french Windows developer channel. The answer is that the 
Windows terminal uses ANSI charset even if it's possible to use 
unicode. So it's a bug in Microsoft msvcrt library (directly in the 
terminal implementation), not in Python.

Anyway I think that my patch (msvcrt_wchar.patch) makes the situation 
better ;-)

--

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



[issue5410] msvcrt bytes cleanup

2009-04-18 Thread STINNER Victor

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

 MSDN says _ungetwch returns WEOF instead of EOF when error occurs.

Ok, I updated my patch (to use WEOF).

--
Added file: http://bugs.python.org/file13718/msvcrt_wchar-2.patch

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



[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Aleksi Torhamo

New submission from Aleksi Torhamo alexerion+pythonb...@gmail.com:

object.__getattribute__(super, '__bases__') crashes the interpreter.

It seems to happen at Objects/typeobject.c in type_get_bases(), when
tp_bases is NULL.

Crashing types in __builtins__ per version would seem to be:
python2.4: slice frozenset super staticmethod float enumerate long
xrange tuple reversed property complex buffer classmethod
python2.5: slice frozenset super staticmethod float enumerate long
xrange reversed property complex buffer classmethod
python2.6: slice super staticmethod float enumerate long xrange reversed
python3.0: memoryview slice super filter range staticmethod float
enumerate reversed map

2.7 and 3.1 not tested since i don't have them installed.

--
components: Interpreter Core
messages: 86126
nosy: alexer
severity: normal
status: open
title: object.__getattribute__(super, '__bases__') crashes the interpreter.
type: crash
versions: Python 2.4, Python 2.5, Python 2.6, Python 3.0

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



[issue1580] Use shorter float repr when possible

2009-04-18 Thread Antoine Pitrou

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

Hello folks,

IIUC, autoconf tries to enable SSE2 by default without asking. Isn't it
a problem for people distributing Python binaries (e.g. Linux vendors)
and expecting these binaries to work on legacy systems even though the
system on which the binaries were compiled supports SSE2?

Or am I misunderstanding what the changes are?

--
nosy: +pitrou

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



[issue3633] float.fromhex discrepancy under Solaris

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

A postscript:  looking back at this from afar, the original error was 
almost certainly due to a missing Py_CHARMASK around the arguments
to isdigit and isxdigit, and nothing to do with Unicode fullwidth digits 
at all.

--

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



[issue1580] Use shorter float repr when possible

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Yes, I think you're right.

Perhaps the SSE2 support should be turned into an --enable-sse2 configure 
option, that's disabled by default?  One problem with this is that I don't 
know how to enable SSE2 instructions for compilers other than gcc, so the 
option would only apply to gcc-based systems.

Disabling SSE2 would just mean that all x86/gcc systems would end up using 
the inline assembler to get and set the control word;  so we'd still get 
short float repr everywhere we did before.

--

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



[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Benjamin Peterson

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


--
assignee:  - rhettinger
nosy: +rhettinger

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



[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Raymond, this was your change in r67478 (backported to trunk in r67498).

--
nosy: +georg.brandl

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



[issue1580] Use shorter float repr when possible

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Perhaps better to drop the SSE2 bits completely.  Anybody who
actually wants SSE2 instructions in their binary can do a

CC=gcc -msse2 -mfpmath=sse configure  ...

Unless there are objections, I'll drop everything involving SSE2 from 
the configure script.

It's a bit of a shame, though:  it's definitely desirable to be using 
the SSE2 instructions for floating-point whenever possible.  Fewer 
surprises due to double rounding or random 80-bit register spilling, 
better performance on underflow and NaNs, ...

--

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan

New submission from Brian Quinlan br...@sweetapp.com:

...in seconds-based library functions (e.g. time.sleep) and calculations
(e.g. distance = velocity * ?).

--
components: Library (Lib)
messages: 86132
nosy: bquinlan
severity: normal
status: open
title: datetime.timedelta is inconvenient to use...
versions: Python 3.0, Python 3.1

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan

Changes by Brian Quinlan br...@sweetapp.com:


--
keywords: +patch
Added file: http://bugs.python.org/file13719/totalseconds.diff

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Please include a proper description of your problem, and a patch
description when you post a patch.

--
nosy: +georg.brandl

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



[issue5771] SA bugs with unittest...@r71263

2009-04-18 Thread Benjamin Peterson

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

Fixed in r71721.

--
resolution:  - fixed
status: open - closed

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan

Brian Quinlan br...@sweetapp.com added the comment:

I did add a patch description: Adds a datetime.total_seconds attribute
- is that unclear?

The idea is that you should be able to extract the total number of
seconds in the duration i.e.
 dt = datetime.timedelta(seconds=1234567.89)
 dt.total_seconds
1234567.89

--

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I saw the patch description as well, but usually you put that
description, and perhaps a motivation as well, in the comment. That way
it's easier for people to directly see what an issue is about.

--

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



[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Benjamin Peterson

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

Should be fixed in r71722.

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

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan

Brian Quinlan br...@sweetapp.com added the comment:

OK, a bit on motivation:
1. datetime.timedelta instances are a convenient way of representing
   durations
2. datetime.timedelta instances cannot be conveniently used in many
   calculations e.g. calculating distance based on velocity and time
3. datetime.timedelta instances cannot be conveniently used in many
   library functions e.g. time.sleep(), urllib2.urlopen(timeout=)

I propose to fix that by adding a timedelta.total_seconds attribute that
equals:
timedelta.days * 3600 * 24 + timedelta.seconds + timedelta.microseconds
/ 10.0

--

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



[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Aarni Koskela

Aarni Koskela a...@iki.fi added the comment:

The r71722 patch has several typos (replace initalize with initialize).

--
nosy: +akx

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



[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Aleksi Torhamo

Aleksi Torhamo alexerion+pythonb...@gmail.com added the comment:

Just verified that r71722 fixes all the builtins, however i just noticed
that some types under module types cause segfaults too.

Under python2.7 those are: CodeType BuiltinMethodType DictProxyType
GeneratorType GetSetDescriptorType EllipsisType FrameType InstanceType
MemberDescriptorType

Not sure, but i'm guessing there might be yet more types somewhere, that
need fixing (as the only places i've looked at are __builtins__ and
types - the first ones to cause problems/come to mind). Would there be
some way to find out all defined types, or to fix this for all types in
a single place?

--
status: closed - open

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



[issue1580] Use shorter float repr when possible

2009-04-18 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

SSE2 detection and flags removed in r71723.  We'll see how the buildbots 
fare...

--

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



[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Benjamin Peterson

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

The rest should be fixed in r71734.

--

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



[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Benjamin Peterson

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


--
status: open - closed

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



[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Raymond Hettinger

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

Guido decided that iterators should not support len() because he wanted
bool(it) to always be True.

--
resolution:  - invalid
status: open - closed

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



[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Antoine Pitrou

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

Uh, perhaps the behaviour wasn't optimal but breaking compatibility
between two bugfix releases isn't developer-friendly either.

While we could keep it in trunk, it sounds like the change should be
reverted in 2.6.
The backport to 2.6 was done by Georg in r67569, by the way :-)

--
nosy: +pitrou
resolution: invalid - 

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



[issue1580] Use shorter float repr when possible

2009-04-18 Thread Antoine Pitrou

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

 Is there a way to use SSE when available and x86 when it's not.

Probably, but I don't think there is any point doing so. The main
benefit of SSE2 is to get higher performance on floating point intensive
code, which no pure Python code could be regarded as (the CPU cycles
elapsed between two FP instructions would dwarf the cost of executing
the FP instructions themselves).

The situation is different for specialized packages like numpy, but
their decisions need not be the same as ours AFAIK.

--

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou

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

The addition looks quite legitimate to me.
The only thing is that it may be better as a method (total_seconds())
rather than an attribute, given the other APIs in the datetime module.
Also, the patch lacks some unit tests.

--
nosy: +pitrou
versions: +Python 2.7 -Python 3.0

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou

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


--
priority:  - normal
stage:  - patch review
type:  - feature request

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



[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou

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

Sorry for the last comment about unit tests, they are here actually :-)

--

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



[issue1580] Use shorter float repr when possible

2009-04-18 Thread Raymond Hettinger

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

The advantage is accuracy.  No double rounding.  This will also help the
math.fsum() function that is also susceptible to double rounding.

--

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



[issue5734] Fix BufferedRWPair

2009-04-18 Thread Antoine Pitrou

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

The patch looks ok, thanks.

--
resolution:  - accepted
stage: patch review - commit review

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2009-04-18 Thread Elliot Murphy

Changes by Elliot Murphy elliot.mur...@gmail.com:


--
nosy: +statik

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



[issue5734] Fix BufferedRWPair

2009-04-18 Thread Antoine Pitrou

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

Committed in r71736.

--
resolution: accepted - fixed
status: open - closed

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



[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Aleksi Torhamo

Aleksi Torhamo alexerion+pythonb...@gmail.com added the comment:

Stumbled upon a few more.

python2.4/2.5: socket.SSLType re._pattern_type weakref.ProxyType
weakref.CallableProxyType
python2.6/2.7: weakref.ProxyType weakref.CallableProxyType
python3.0: weakref.ProxyType weakref.CallableProxyType _abcoll.dict_proxy

I'll also mention MLab.arraytype and MLab.UfuncType, though they are in
a third-party module..

Btw, should this be kept open until this is backported to 2.4/2.5 as well?

--
status: closed - open

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



[issue5786] len(reversed([1,2,3])) does not work anymore in 2.6.2

2009-04-18 Thread Raymond Hettinger

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

It's up to you guys.  I had thought to change it only for Py2.7 but
Guido probably considers it to be a bug, so possibly the backport was
justified.

--
assignee: rhettinger - 
status: closed - open

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



[issue5787] object.__getattribute__(super, '__bases__') crashes the interpreter.

2009-04-18 Thread Benjamin Peterson

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

Fixed the ones applicable to 2.7/2.6 in r71738. These fixes won't be
backported to 2.4/2.5.

--
status: open - closed

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



[issue5789] powerset recipe listed twice in itertools docs

2009-04-18 Thread Steven D'Aprano

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

In the itertools recipes section of the docs, powerset() is listed 
twice.

http://docs.python.org/library/itertools.html#recipes

--
assignee: georg.brandl
components: Documentation
messages: 86155
nosy: georg.brandl, stevenjd
severity: normal
status: open
title: powerset recipe listed twice in itertools docs
versions: Python 2.6

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



[issue5790] itertools.izip python code has a typo

2009-04-18 Thread Steven D'Aprano

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

In the documentation for itertools, the Python equivalent to izip has 
a typo:

yield yield tuple(map(next, iterables))

Obviously should only have a single yield.

http://docs.python.org/library/itertools.html#itertools.izip

--
assignee: georg.brandl
components: Documentation
messages: 86156
nosy: georg.brandl, stevenjd
severity: normal
status: open
title: itertools.izip python code has a typo
versions: Python 2.6

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



[issue5790] itertools.izip python code has a typo

2009-04-18 Thread Raymond Hettinger

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


--
assignee: georg.brandl - rhettinger
nosy: +rhettinger

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



[issue1537721] csv module: add header row to DictWriter

2009-04-18 Thread Matthew Iversen

Matthew Iversen teh@gmail.com added the comment:

Skip, you were arguing in another csv issue on a NamedTupleReader that
the Reader and Writer should work in concert together.

Certainly, making this default functionality for DictWriter would
definitely make it work more in concert with DictReader.

A sample process of reading and writing might be:

1. DictReader reads in header names, reads in data
2. Pass in header names to DictWriter on init
3. DictWriter writes out modified data back to csv file (headers get
written automatically or with a method call)
4. DictReader can now reader in the csv file automatically again with
header names

My feeling is, if DictReader can read in head names, why can't
DictWriter write them back out again? Shouldn't there be a good amount
of symmatry to their function/abilities?

My feeling of how to implement this functionality would be to include a
new init argument, say 'writeheader'. It's default would be True if you
wanted to implement this new feature by default, or False if you wanted
to keep it an option so that older scripts relying on the old
functionality won't break immmediately.
DictWriter would then write the header on the first call to writerow(s),
or perhaps also with an explicit call to writeheader() say.

I certainly am miffed by the fact that DictWriter cannot produce
(normally) a csv file that DictReader can read in automatically.

--
nosy: +ivo

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