[issue13122] Out of date links in the sidebar of the documentation index of versions 3.1 and 3.2

2011-10-07 Thread Sven Marnach
New submission from Sven Marnach : The sidebar on http://docs.python.org/release/3.1.3/ names 3.2 as the development version of Python, while the link points to 3.3. The sidebar on http://docs.python.org/py3k/ links to 3.1 as the "stable version" -- obviously a relict from the tim

[issue13145] Documentation of PyNumber_ToBase() wrong

2011-10-10 Thread Sven Marnach
New submission from Sven Marnach : The documentation of PyNumber_ToBase() [1] states When base is not 2, 8, 10, or 16, the format is 'x#num' where x is the base. In reality, the function does not accept any bases different from 2, 8, 10, or 16, as can be seen in the sour

[issue13199] slice_richcompare() might leak an object in rare cases

2011-10-17 Thread Sven Marnach
New submission from Sven Marnach : If exactly one of the two tuple allocations in [1] fails, the tuple that is successfully allocated won't be freed. (This probably never happened. Are you interested in this kind of bug report anyway?) [1]: http://hg.python.org/cpython/file/f6b3ad3

[issue13200] Add start, stop and step attributes to range objects

2011-10-17 Thread Sven Marnach
New submission from Sven Marnach : As discussed on python-ideas [1], range objects should expose their start, stop and step values as read-only data attributes. I've attached a patch to this end. I'll open a separate issue for range comparison. [1]: http://mail.python.org/piperm

[issue13201] Implement comparison operators for range objects

2011-10-17 Thread Sven Marnach
New submission from Sven Marnach : It seems some sort of consensus on how to compare range objects has emerged from the python-ideas discussion on comparison of range objects [1]. The attached patch defines '==' and '!=' for range object equality based on the sequence of v

[issue13200] Add start, stop and step attributes to range objects

2011-10-17 Thread Sven Marnach
Sven Marnach added the comment: Thanks, Éric. Added new version of the patch. (Could I also edit the old one?) -- Added file: http://bugs.python.org/file23427/range-members.patch ___ Python tracker <http://bugs.python.org/issue13

[issue13201] Implement comparison operators for range objects

2011-10-17 Thread Sven Marnach
Sven Marnach added the comment: Mark, thanks for your comments. Here's a new version of the patch, I answer on Rietveld. -- Added file: http://bugs.python.org/file23429/range-compare-v2.patch ___ Python tracker <http://bugs.python.org/is

[issue13201] Implement comparison operators for range objects

2011-10-18 Thread Sven Marnach
Sven Marnach added the comment: Mark, thanks again for your comments. (I never looked at the Python source code before, so tey are highly appreciated.) I uploaded a new version of the patch hopefully. -- Added file: http://bugs.python.org/file23441/range-compare-v3.patch

[issue13201] Implement comparison operators for range objects

2011-10-22 Thread Sven Marnach
Sven Marnach added the comment: Thanks for the updates, Mark. I was just about to look into this again. The changes are fine with me. -- ___ Python tracker <http://bugs.python.org/issue13

[issue13201] Implement comparison operators for range objects

2011-10-22 Thread Sven Marnach
Sven Marnach added the comment: Victor Stinner wrote: > If would be nice to have a PyLong_CompareLong() function. In most cases, global variables Py_Zero and Py_One would be enough to simplify this kind of code. -- ___ Python tracker &l

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Sven Marnach
New submission from Sven Marnach : The execfile fixer of the 2to3 script replaces the 2.x code execfile("a.py") by exec(compile(open("a.py").read(), "a.py", 'exec')) The new code does not explicitly close the file. This is not usually a pro

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Sven Marnach
Sven Marnach added the comment: @Petri: Yes, that's what the BaseFix.new_name() method is for. @Antoine: I thought about this, though I don't think it is very common to call execfile() as part of an expression. The whole statement containing the function call would need to

[issue13332] execfile fixer produces code that does not close the file

2011-11-03 Thread Sven Marnach
Sven Marnach added the comment: Getting the general case right seems a bit too difficult. Examples like [execfile(n) for n in names if condition(n)] execfile(execfile(n1) or n2) try: 1 / 0 except execfile(n) or ZeroDivisionError: pass would require rather complex

[issue13585] Add contextlib.CleanupManager

2011-12-12 Thread Sven Marnach
Sven Marnach added the comment: There is actually a second thread on python-ideas on a very similar topic, see http://mail.python.org/pipermail/python-ideas/2011-December/013021.html The two main advantages of the proposed CleanupManager over try/finally blocks are 1. You can add a

[issue13585] Add contextlib.CleanupManager

2011-12-13 Thread Sven Marnach
Sven Marnach added the comment: I think that the fact that Nick got the code to close multiple files wrong underlines that it is difficult to get right currently. Nick's code try: files = [open(fname) for fname in names] # ... finally: for f in

[issue4296] Python assumes identity implies equivalence; contradicts NaN

2011-06-27 Thread Sven Marnach
Sven Marnach added the comment: The behaviour discussed in this thread does not seem to be reflected in Python's documentation. The documentation of __eq__() [1] doesn't mention that objects should compare equal to themselves. [1]: http://docs.python.org/dev/reference/datamodel.h

[issue14165] The new shlex.quote() function should be marked "New in version 3.3"

2012-03-01 Thread Sven Marnach
New submission from Sven Marnach : The function shlex.quotes() [1] does not yet exist in Python 3.2 [2], so it should be marked "New in version 3.3." in the docs. I double-checked that it really does not yet exist in 3.2 and is not only missing from the 3.2 documentation.

[issue14456] Relation between threads and signals unclear

2012-03-30 Thread Sven Marnach
New submission from Sven Marnach : The documentation of the 'signal' module states on the one hand [T]he main thread will be the only one to receive signals (this is enforced by the Python signal module, even if the underlying thread implementation supports sending

[issue8407] expose pthread_sigmask(), pthread_kill(), sigpending() and sigwait() in the signal module

2012-03-30 Thread Sven Marnach
Sven Marnach added the comment: The documentation has been left in a confusing state by this patch -- at least confusing to me. I've created issue14456 with further details. -- nosy: +smarnach ___ Python tracker <http://bugs.python.org/i

[issue14456] Relation between threads and signals unclear

2012-03-30 Thread Sven Marnach
Sven Marnach added the comment: For reference: the functions 'pthread_kill()' etc. were intrduced in issue8407. -- ___ Python tracker <http://bugs.python.o

[issue14456] Relation between threads and signals unclear

2012-03-31 Thread Sven Marnach
Sven Marnach added the comment: Thanks, Antoine! It's perfectly clear now, and the newly introduces headlines are a definite improvement. -- ___ Python tracker <http://bugs.python.org/is

[issue14494] __future__.py and its documentation claim absolute imports became mandatory in 2.7, but they didn't

2012-04-04 Thread Sven Marnach
New submission from Sven Marnach : As has been pointed out before on python-dev [1], the mandatory version of '__future__.absolute_import' does not match reality. In Python 2.7, absolute imports are not the default. [1]: http://article.gmane.org/gmane.comp.python.devel/125446 Th

[issue30537] Using PyNumber_AsSsize_t in itertools.islice

2017-06-07 Thread Sven Marnach
Sven Marnach added the comment: The current behaviour of islice() seems inconsistent with the rest of Python. All other functions taking start, stop and step arguments like slice(), range() and itertools.count() do accept integer-like objects. The code given as "roughly equivalent&qu

[issue3177] Add shutil.open

2012-04-23 Thread Sven Marnach
Sven Marnach added the comment: The semantics of "associated application" change considerably from operating system to operating system. As an example, ``os.startfile("a.py")`` will usually run `a.py` in the Python interpreter, while ``xdg-open a.py`` it will usually ope