[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Wed, Sep 15, 2010 at 10:51 AM, Benjamin Peterson wrote: > I'm not sure if this pickling stuff matters as long as they both pickle. > I'm not sure either. Do other Python implementations try to maintain a compatible pickle format with CP

[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Removed file: http://bugs.python.org/file18890/unnamed ___ Python tracker <http://bugs.python.org/issue9858> ___ ___ Python-bugs-list mailin

[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Roundup does not play well with Gmail when Gmail is in Rich Format mode ;-) That example should have read: >>> f = io.FileIO(1) >>> f.name 1 -- ___ Python tracker <http://bugs

[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Hmm, none the less other code expects it. Does that imply that there's some code that will break on FileIO objects that are created using a file descriptor instead of a filename? If so, where? -- __

[issue9886] Make operator.itemgetter/attrgetter/methodcaller easier to discover

2010-09-17 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue9886> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9915] speeding up sorting with a key

2010-09-21 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : (I've made an educated guess about who to add to the Nosy list) The attached patch substantially speeds up sorting using the "key" parameter. It is purely a performance patch; the language and libraries are not changed in any other way

[issue9131] test_set_reprs in test_pprint is fragile

2010-09-21 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Committed in r84961 -- stage: patch review -> committed/rejected status: open -> closed type: -> behavior versions: -Python 3.3 ___ Python tracker <http://bugs.python.o

[issue9915] speeding up sorting with a key

2010-09-21 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Antoine said: > I don't think there's any point in micro-optimizations such as > stack_keys. Good point. I'll try taking that out and see how it impacts the timing. Raymond said: > The memmove, memcpy functions are tricky to

[issue9915] speeding up sorting with a key

2010-09-22 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Attached is my script for running a more comprehensive battery of speed tests. The script itself requires Python 2.6 with argparse installed or Python 2.7 (which includes argparse). For obvious reasons, please make sure that your unpatched and patched

[issue9939] Add a pipe type (FIFO) to the io module

2010-09-24 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > It would be a non-seekable in-memory bytes buffer with distinct > read and write pointers, so as to act like a system FIFO or a > socket.makefile() object. What would it do when the equivalent system FIFO object would block? > (you may poin

[issue9939] Add a pipe type (FIFO) to the io module

2010-09-24 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Simply buffer everything. That works for when a write operation would block. What would it do when a read operation would block? -- ___ Python tracker <http://bugs.python.org/iss

[issue9939] Add a pipe type (FIFO) to the io module

2010-09-24 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Another option would be to have the read-end act like a non-blocking socket (i.e., raise EAGAIN). Since it would mostly be for testing, would it make more sense to add it to test.support or someplace similar instead of io

[issue9939] Add a pipe type (FIFO) to the io module

2010-09-24 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > I thought it might be useful for third-party libraries, or even > non-testing situations That might be true, but I prefer that we give code a more vigorous exercise before putting it in the standard library proper. When we try to use it for som

[issue9915] speeding up sorting with a key

2010-09-24 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Since the patch is intended to speed up 3.2 and your posted > experiments were run on that, I am puzzled that you would post a > test script to run under late 2.x instead of 3.1+. I had originally written the test script was originally wr

[issue9915] speeding up sorting with a key

2010-09-24 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Does this help any? No :-) The problem is that the random data you run in interpreter 1 won't be the same data you run in interpreter 2, so the results are not directly comparable. One of the sets of random data may be more easily sortable

[issue9915] speeding up sorting with a key

2010-09-24 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > what about adding a simple "random.seed(12345)" That's an excellent suggestion! In fact, I'm embarrassed that it never occurred to me (especially since I have used it in other projects). I will have a revised speed_test al

[issue9949] os.path.realpath on Windows does not follow symbolic links

2010-09-25 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : In Lib/ntpath.py: # realpath is a no-op on systems without islink support realpath = abspath However, Windows Vista and newer support symbolic links and other Python methods support them. (noticed this through source code inspection; haven't act

[issue9971] Optimize BufferedReader.readinto

2010-09-28 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : The readinto() method is intended to offer better performance than read() by allowing the caller to read into a preallocated buffer rather than constantly allocate and deallocate buffers. However, bufferediobase_readinto() calls read(), so the extra

[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-09-28 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I know enough about Unicode to have reported this bug, but I don't feel knowledgeable enough about Python's Unicode implementation to comment on your suggested solution. I'm adding the other people listed in Misc/maintainers.rst as interes

[issue9979] Create PyUnicode_AsWideCharString() function

2010-09-28 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +ezio.melotti, lemburg ___ Python tracker <http://bugs.python.org/issue9979> ___ ___ Python-bugs-list mailing list Unsub

[issue9989] ctypes bitfield problem

2010-09-29 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : The following program should print "0xdead" but instead prints "0x0". This came from the following stackoverflow question: http://stackoverflow.com/questions/3824617/python-structure-always-stuck-at-0-no-matter-what-value-you-assign-

[issue9989] ctypes bitfield problem

2010-09-29 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Could be. FWIW, I had tested and observed the problem on a 32-bit Intel Windows box and 64-bit Intel Linux box. -- ___ Python tracker <http://bugs.python.org/issue9

[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I, too, can't think of any platforms where Py_UNICODE_SIZE == 4 && SIZEOF_WCHAR_T == 2 and I'm not sure what the previous policy has been. Have you noticed any other code that would set a precedent? If no one else chimes in, perhaps as

[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-01 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > You can tweak the Windows pyconfig.h to use UCS4, AFAIK, if you want to > test drive this case. I seem to recall seeing some other code that assumed Windows implied UCS2. Proceed with caution. ;-) > But it's probably easier to confi

[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Thanks for working on this! Since this was a bugfix, it should be merged back into 2.7, yes? -- stage: unit test needed -> committed/rejected ___ Python tracker <http://bugs.python.org/iss

[issue8670] c_types.c_wchar should not assume that sizeof(wchar_t) == sizeof(Py_UNICODE)

2010-10-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Since I noticed the bug through source code inspection and no one has reported it occurring in practice, that sounds reasonable to me. -- versions: -Python 2.7 ___ Python tracker <http://bugs.python.

[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: For what it's worth, a similar fast path existed in Python 2 for lists (but not tuples). It was removed for Python 3. I'm not sure why it was removed, but it may have been part of removing the PyInt type. -- nosy:

[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-05 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I did some spelunking. Guido committed the similar optimization in r8306. The diff is at: http://svn.python.org/view/python/trunk/Python/ceval.c?r1=8087&r2=8306 His commit message was: Huge speedup by inlining some common integer operat

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-05 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: The code was taken from the itertools.izip documentation for Python 2, where it did work. In Python 2, next() raises StopIteration which is propagated up and causes the izip() to stop. In Python 3, map is itself a generator and the StopIteration

[issue10044] small int optimization

2010-10-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: How does performance change if you adjust NSMALLPOSINTS and NSMALLNEGINTS, but make no other changes? -- ___ Python tracker <http://bugs.python.org/issue10

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > I suggest removing the "equivalent to" code from the zip section and > replacing it with an example showing how to use zip with a for loop > similar to the example illustrating enumerate. +1 -- ___

[issue10044] small int optimization

2010-10-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > I don't think arbitrary comparisons of pointers give well-defined > results, unless those pointers both happen to point into the same > array. (Might be wrong; I don't have a copy of the C standard to > hand.) Technically arbitrary

[issue10059] add the method `index` to collections.deque

2010-10-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Hello Simon, Accessing an arbitrary element of a deque takes O(n) time, making your .index implementation O(n**2). If you describe the kinds of operations that you need to perform efficiently, we may be able to suggest a better data structure for you to

[issue10029] "Equivalent to" code for zip is wrong in Python 3

2010-10-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Daniel, we need to sync-up on the meaning of marking a report as > "accepted". Traditionally it denotes an approved patch, not a agreement > > that the bug is valid. Woops! Thanks for the correction. For what it's worth, a q

[issue10071] Should not release GIL while running RegEnumValue

2010-10-12 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Hirokazu, could you run Python in a debugger and figure out exactly which line crashes and what the error is? I'm curious. If we make this change, the same change should be applied to RegEnumKey, etc., since the RegEnumKey docs contain similar lan

[issue10100] fromfd is now available on all platforms

2010-10-14 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : fromfd is marked as Availability: Unix, but in Python 3 it is also available on Windows: C:\>c:\python31\python.exe Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", &qu

[issue10099] socket.fromfd() documentation problem

2010-10-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue10099> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9730] base64 docs refers to strings instead of bytes

2010-10-17 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: That fixes the example code, but what about the numerous text that reads "strings" that should read "byte sequences", "bytes", or similar? -- ___ Python tracker <

[issue10437] ThreadPoolExecutor should accept max_workers=None

2010-11-16 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : ProcessPoolExecutor allows the max_workers parameter to the constructor to be omitted or None, in which case it will set the max_workers based on the number of CPUs. It would be nice if ThreadPoolExecutor's constructor worked the same way; havin

[issue10868] ABCMeta.register() should work as a decorator

2011-02-24 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: In what use-cases would you want to call MyABC.register() when defining a class instead of inheriting from MyABC? I always thought of the register() as hack to make it possible to support types written in C, which can't inherit from th

[issue11333] Add empty __slots__ to collections.abc abstract base classes

2011-02-26 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: +1. I've bumped into exactly this problem (https://github.com/DanielStutzbach/blist/issues/closed#issue/29) I'm not intimately familiar with how __slots__ works. Are there any drawbacks to adding an empty __slots__ t

[issue10868] ABCMeta.register() should work as a decorator

2011-02-26 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Sounds good to me. Thanks for the clarifications and satisfying my curiosity! :-) -- ___ Python tracker <http://bugs.python.org/issue10

[issue11335] Memory leak after key function failure in sort

2011-02-26 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : In list.sort, if a key function throws an exception, the memory to store the keys is never freed. I introduced the bug in r86937. I'll upload a patch for review shortly. -- assignee: stutzbach components: Interpreter Core messages: 129574

[issue11335] Memory leak after key function failure in sort

2011-02-26 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Below is a link to the code where leak occurs and the patch goes: http://svn.python.org/view/python/branches/py3k/Objects/listobject.c?view=markup&pathrev=88554#l1944 -- keywords: +3.2regression, needs review, patch Added file:

[issue4600] __class__ assignment: new-style? heap? == confusing

2011-02-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue4600> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11335] Memory leak after key function failure in sort

2011-03-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I'm not sure. What infrastructure do we have to leaked memory that was allocated with PyMem_MALLOC? -- ___ Python tracker <http://bugs.python.org/is

[issue11335] Memory leak after key function failure in sort

2011-03-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I meant "to *detect* leaked memory", of course. :-) -- ___ Python tracker <http://bugs.python.org/issue11335> ___ ___

[issue11335] Memory leak after key function failure in sort

2011-03-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I played around with this a little. That code path doesn't appear to be exercised during the existing unit tests. I'll add a test so the leak at least shows up when the tests are run unde

[issue1553375] Add traceback.print_full_exception()

2011-03-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/issue1553375> ___ ___ Python-bug

[issue9427] logging.error('...', exc_info=True) should display upper frames, too

2011-03-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- dependencies: +Add traceback.print_full_exception() nosy: +stutzbach versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/issue9

[issue11402] _PyUnicode_Init leaks a little memory once

2011-03-04 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : By the time _PyUnicode_Init is called and does the following: /* Init the implementation */ free_list = NULL; numfree = 0

[issue11402] _PyUnicode_Init leaks a little memory once

2011-03-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- keywords: +needs review, patch Added file: http://bugs.python.org/file20999/unicode-leak.patch ___ Python tracker <http://bugs.python.org/issue11

[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-10 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: For what it's worth, I believe this could be implemented easily by calling _PyDict_HasOnlyStringKeys at the end of the class creation process. -- nosy: +stutzbach ___ Python tracker <http://bugs.py

[issue11480] Cannot copy a class with a metaclass other than type

2011-03-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- keywords: +needs review nosy: +alexandre.vassalotti, stutzbach stage: -> patch review ___ Python tracker <http://bugs.python.org/issu

[issue11562] += on list inside a tuple raises TypeError but succeds anyway

2011-03-15 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach stage: -> test needed versions: +Python 3.2 ___ Python tracker <http://bugs.python.org/issue11562> ___ ___ Py

[issue11583] os.path.isdir() is slow on windows

2011-03-17 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11583> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11608] GzipFile cannot be used for streaming

2011-03-19 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11608> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11628] cmp_to_key generated class should use __slots__

2011-03-21 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11628> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11635] concurrent.futures uses polling

2011-03-22 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11635> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11640] Shelve references globals in its __del__ method

2011-03-22 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach versions: +Python 3.3 ___ Python tracker <http://bugs.python.org/issue11640> ___ ___ Python-bugs-list mailin

[issue11674] list(obj), tuple(obj) swallow TypeError (in _PyObject_LengthHint)

2011-03-25 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11674> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2011-03-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I'm confused by the patch (ed0259230611). The patch comment and the NEWS item state "the returned socket is now always non-blocking" but the code change adds "sock.setblocking(True)". --

[issue11707] Create C version of functools.cmp_to_key()

2011-04-01 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11707> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6634] sys.exit() called from threads other than the main one: undocumented behaviour

2011-04-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue6634> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11845] Refcounting error in compute_slice_indices in rangeobject.c

2011-04-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11845> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11854] __or__ et al instantiate subclass of set without calling __init__

2011-04-16 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11854> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11335] Memory leak after key function failure in sort

2011-05-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I checked in a fix to 3.3 just before the transition to hg. I confess that I've been procrastinating on getting hg set up properly, which is why I haven't gotten to checking this in to 3.2. Georg, if I get this in by Wednesday, will that be s

[issue11994] [2.7/gcc-4.4.3] Segfault under valgrind in string.split()

2011-05-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue11994> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11335] Memory leak after key function failure in sort

2011-05-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue9971] Optimize BufferedReader.readinto

2011-05-04 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Looking at this again, I agree with John. For BufferedIOBase, read() is abstract while readinto() is concrete. That seems backward, and, indeed, it's the opposite of RawIOBase, where readinto() is abstract and read() is concrete. Unfortunately, this

[issue12128] Allow `abc.abstractproperty` to be overridden by a data attribute

2011-05-20 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: SGTM. I've written code where this would have been useful. Could you write a patch? -- nosy: +stutzbach stage: -> needs patch ___ Python tracker <http://bugs.python.org

[issue12127] Inconsistent leading zero treatment

2011-05-20 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: -0 on making it valid ever, due to the different meaning in many other languages. -1 on making it valid while many still use a version of python where it's valid with a different meaning. Maybe for Python 4. ;-) -- nosy: +stut

[issue12128] Allow `abc.abstractproperty` to be overridden by a data attribute

2011-05-20 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I misread the original request. I'm +1 on making the following work, if it doesn't work already: class MySubClass(MyAbstractClass): SOME_LIMIT = 5 # Implements abstract property with fixed value We should be able to check that at instanc

[issue12128] Allow `abc.abstractproperty` to be overridden by a data attribute

2011-05-20 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Daniel, the behavior you describe is already present in Python 3.2. Awesome. :) Do you have a compelling use-case for making "self.x = 5" satisfy an abstractproperty requirement? One of the problems with that approach is that the inst

[issue10437] ThreadPoolExecutor should accept max_workers=None

2010-11-20 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: In my case, each thread launches a CPU-intensive process via subprocess, then waits for it to report output and exit. Also, keep in mind that PyPy and IronPython don't have a GIL (although I'm not a PyPy or IronPython u

[issue10437] ThreadPoolExecutor should accept max_workers=None

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Amaury Forgeot d'Arc said: > pypy does have a GIL! D'oh. That shows you how much I know about PyPy. Make that "keep in mind that IronPython doesn't have a GIL". ;) Brian Quinlan said: > I think that using the number of C

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I'm starting to get settled in here at Google and finding time to follow up on everything that got put on hold while moving. Based on the feedback everyone gave me (thanks!), I greatly revised my script for comparing the speed of sort(). It's no

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Added file: http://bugs.python.org/file19780/sort-faster.patch ___ Python tracker <http://bugs.python.org/issue9915> ___ ___ Python-bug

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Added file: http://bugs.python.org/file19781/detailed-speed-results.txt ___ Python tracker <http://bugs.python.org/issue9915> ___ ___ Pytho

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Antoine Pitrou wrote: > Why don't you contribute a list sorting benchmark to the suite in > http://hg.python.org/benchmarks/? I considered that, but I want to separately benchmark sorting different kinds and quantities of data. AFAIK, there is

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Antoine Pitrou wrote: > Right, that wouldn't suit your present purposes. But apparently you > are proposing to add a list sorting benchmark to the Tools directory, > with lots of duplicated code from that repo... Oh, I just stuck that under

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Raymond Hettinger added the comment: > That result is surprising though -- I thought the concept was > manipulate the key and value arrays at the same time instead of just > the keys If the "key" parameter was not used, then the value

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > How did it get *faster* than the original (in the case with no > key-function)? I was able to shave off some instructions in countrun(), binarysort(), and the setup and cleanup code in listsort() proper. For small n, these made a difference.

[issue9915] speeding up sorting with a key

2010-11-23 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Antoine Pitrou wrote: > Next time, please upload a single patch. Really. I haven't used Rietveld that much yet, and I'm still learning best-practices. I apologize for the painful experience. For anyone else planning to take a look at this,

[issue9915] speeding up sorting with a key

2010-11-23 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Antoine, My original patch was much more focused, but had a slightly larger performance penalty for sorting random keys (see http://bugs.python.org/msg122178). Do you think the performance tradeoff there was still worthwhile? Ihave uploaded my original

[issue10576] Add a progress callback to gcmodule

2010-11-29 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: These functions will be very useful for any long-running program. Thank you for the patch. Would you be willing to write tests and documentation? Would it make more sense for the callback to take a boolean instead of an integer as the first argument

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > How about a string and a dict? the string can be "start" and "stop" > and we can add interesting information to the dict as you suggest. I like where this is headed. How about putting the string in the dict,

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : The I/O ABC documentation has a blanket disclaimer at the top: "The abstract base classes also provide default implementations of some methods in order to help implementation of concrete stream classes. For example, BufferedIOBase pro

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: +io and doc people Attached is a simple patch to add a table to the documentation summarizing the I/O ABCs. -- keywords: +patch nosy: +benjamin.peterson, ezio.melotti, georg.brandl Added file: http://bugs.python.org/file19885/io-abc.diff

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > What does "unsupported" mean? "Abstract" would look more exact. It means they raise io.UnsupportedOperation when called (unless the subclass overrides them to do something else). They are not marked with @abstractmethod, so &q

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Other suggestions for a better name for that column are certainly welcome. :-) "Stub Methods"? -- ___ Python tracker <http://bugs.python.o

[issue8743] set() operators don't work with collections.Set instances

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Yes, I can take a stab at it. -- ___ Python tracker <http://bugs.python.org/issue8743> ___ ___ Python-bugs-list mailin

[issue9915] speeding up sorting with a key

2010-12-01 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Antoine and Raymond, thank you for the valuable feedback. Attached is a revised version of the patch, which restricts changes to those directly related to moving elements in the keys and values arrays at the same time. I apologize for having gotten a

[issue9915] speeding up sorting with a key

2010-12-01 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > The use of Py_LOCAL_INLINE is new to me since we usually use #define > instead, but this has a cleaner look to it. I am unclear on whether > all the our target compilers support an inline keyword. If you're > sure it works everywhere,

[issue9915] speeding up sorting with a key

2010-12-01 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Just wanted to post this so there weren't any illusions about the > patch being a big win. > When a key function is defined, this is all you can possibly shave > off the time for a comparison. I don't want to argue whether the patch

[issue9915] speeding up sorting with a key

2010-12-02 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Committed as r86937. Thanks again for reviewing! Although I do not anticipate any problems, I will keep an eye on the buildbots just in case. Antoine, regarding "ms->alloced = (list_size + 1) / 2;", I ended up adding an extensive comm

[issue9915] speeding up sorting with a key

2010-12-02 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- components: +Interpreter Core -Library (Lib) resolution: -> accepted stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue2690] Precompute range length and enhance range subscript support

2010-12-03 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > (I also noticed that the new methods from issue #9213 are not mentioned > in the range() docs Wasn't that fixed in Issue9746? -- ___ Python tracker <http://bugs.python

[issue2690] Precompute range length and enhance range subscript support

2010-12-03 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > The descriptions of range's limitations there is no longer accurate > (slicing is supported following this patch and containment testing is > now efficient) Want to open a new issue for that? (or is the

[issue2690] Precompute range length and enhance range subscript support

2010-12-03 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: The descriptions of range's limitations in the docs still needs an update. -- assignee: georg.brandl -> ncoghlan status: closed -> open ___ Python tracker <http://bugs.python

<    1   2   3   4   5   >