[issue9859] Add tests to verify API match of modules with 2 implementations

2015-04-14 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: With regret, I have not had time to work on patches and am unlikely to have time in the near future. -- ___ Python tracker <http://bugs.python.org/issue9

[issue23565] local_clear walks the list of threads without holding head_lock.

2015-03-02 Thread Daniel Stutzbach
New submission from Daniel Stutzbach: local_clear in _threadmodule.c walks the list of threads without holding head_mutex. Since the list of threads can change when holding only head_mutex and not on the GIL, the list can change while local_clear is executing, which may cause Bad Things to

[issue19081] zipimport behaves badly when the zip file changes while the process is running

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

[issue18606] Add statistics module to standard library

2013-08-04 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: As the person originally trying to take the mean of timedelta objects, I'm personally fine with the workaround of: py> m = statistics.mean([x.total_seconds() for x in data]) py> td(seconds=m) datetime.timedelta(2, 43200) At the time I was trying

[issue2226] Small _abcoll Bugs / Oddities

2013-01-16 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- assignee: stutzbach -> rhettinger ___ Python tracker <http://bugs.python.org/issue2226> ___ ___ Python-bugs-list mai

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-17 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Tue, Apr 17, 2012 at 4:08 AM, Antoine Pitrou wrote: > has_finalizer() in gcmodule.c doesn't check for weakref callbacks, so a > weakref callback can still be invoked from tp_dealloc. Unless I'm mistaken, weakrefs will be handle

[issue14534] Add method to mark unittest.TestCases as "do not run".

2012-04-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Wouldn't the subclass inherit the False value? Then the user would need to remember to override the value again in the subclass, which is error prone. Antoine: I've used the pattern you describe on a couple of occasions, and it routinely confus

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-06 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Are __del__ and tp_del getting conflated in this conversation? I don't see a __del__ method on generator objects: filfre:$ python3.1 Python 3.1.2 (r312:79147, Dec 9 2011, 20:47:34) [GCC 4.4.3] on linux2 >>> (i for i in range(5)).__del__ T

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-06 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Fri, Apr 6, 2012 at 12:51 PM, Jim Jewett wrote: > __del__ methods do run, even if an object was collected by the cycle > detector. And they can't do any harm that couldn't also be done by a C > finalizer. > No, if an object wi

[issue13804] Python library structure creates hard to read code when using higher order functions

2012-01-18 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Ah - in your first example (the one with 3 lines) did you mean to use .extend instead of .append? -- ___ Python tracker <http://bugs.python.org/issue13

[issue13804] Python library structure creates hard to read code when using higher order functions

2012-01-17 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: If I'm understanding Martin Häcker's code correctly, the list comprehension equivalent is: self.questions = [topic.questions for topic in self.topics] The reduce() variants are not only much harder to read, but they will take O(n**2) operatio

[issue13742] Add a key parameter (like sorted) to heapq.merge

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

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2011-09-29 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Gladly. :-) -- resolution: -> out of date stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue12682] Meaning of 'accepted' resolution as documented in devguide

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

[issue12612] Valgrind suppressions

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

[issue11640] Shelve references globals in its __del__ method

2011-08-01 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Could you add a comment above the lines defining self._BytesIO, describing why they're being set? Someone else might see them as unnecessary and rip them out if there's no explanation. Can a test launch Python in a subprocess, set up the approp

[issue12434] Strengthen 2.7 io types warning

2011-07-18 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Sat, Jul 16, 2011 at 2:04 AM, Eli Bendersky wrote: > Therefore, I propose to change this error message to: > "unicode argument expected, got '%s'" > as Terry suggested. > Sounds good to me. -- Added file:

[issue12345] Add math.tau

2011-06-17 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Wed, Jun 15, 2011 at 8:10 PM, Nick Coghlan wrote: > I'd like to add a new constant to the math module: > > tau = 2*math.pi > > Rather than repeating all the reasons for why tau makes more sense than pi > as the fundamental cir

[issue12192] Doc that collection mutation methods return item or None

2011-05-27 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > Comment: This rule applies to special methods like __getitem__ > and __setitem__. 'lis.append(item)' is equivalent to > lis.__setitem__(len(lis):len(lis), item), so it should not be so > surprising that it has the same return. It'

[issue8777] Add threading.Barrier

2011-05-26 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- stage: -> committed/rejected ___ Python tracker <http://bugs.python.org/issue8777> ___ ___ Python-bugs-list mailing list Un

[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

[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

[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: 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

[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

[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

[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-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

[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:

[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:

[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:

[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:

[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)". --

[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:

[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

[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:

[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:

[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:

[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:

[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

[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

[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

[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

[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

[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

[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

[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

[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'm not sure. What infrastructure do we have to leaked memory that was allocated with PyMem_MALLOC? -- ___ Python tracker <http://bugs.python.org/is

[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-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:

[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

[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

[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-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

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Thu, Feb 3, 2011 at 12:18 PM, Antoine Pitrou wrote: > I just took a look at http://pypi.python.org/pypi/python-daemon/, and it > uses dup2() to redirect standard streams, which is far nicer. I'm more worried about the case where a daemon laun

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Thu, Feb 3, 2011 at 11:56 AM, Alexander Belopolsky wrote: > 3rd party extensions.    What is the use case for "python >&-"?    Is > it important enough to justify the risk of accidental data loss? I don't think closing stder

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: That's an interesting point. Do you know of places where we use fd 2 instead of sys.stderr? -- ___ Python tracker <http://bugs.python.org/i

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-17 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue8753> ___ ___ Python-bugs-list mailing list Unsubscri

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-17 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Fri, Dec 17, 2010 at 2:17 PM, Amaury Forgeot d'Arc wrote wrote: > Err... in r87339 there is a typo in all occurrences of > 'Py_ReprEntr': Py_ReprEnter of course! Well, that's emba

[issue2690] Precompute range length and enhance range subscript support

2010-12-17 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Doc change committed to py3k in r87346. Thanks, SilentGhost! I also committed r87349 to reverse r87162 (which was in the wrong branch). -- ___ Python tracker <http://bugs.python.org/issue2

[issue2226] Small _abcoll Bugs / Oddities

2010-12-17 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Raymond, Do you have around 10 minutes today to look at the patch I submitted in Issue 8743? It appears to solve both this issue and that one, which have priorities critical and high, respectively. It's a reasonably small patch: around 20 lines ch

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-17 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Committed in r87339. Thanks everyone for the feedback! -- assignee: eric.araujo -> stutzbach keywords: -needs review resolution: -> accepted stage: patch review -> committed/rejected status: open -> closed versions:

[issue8040] It would be nice if documentation pages linked to other versions of the same document

2010-12-16 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: On Tue, Dec 14, 2010 at 7:22 PM, Ezio Melotti wrote: > If you want to work on this you should also consider that the URLs used on > docs.python.org don't necessary match the directory structure present when > building the doc locally. For e

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-15 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Thanks. New patch attached with a cross-reference to reprlib.recursive_repr. -- Added file: http://bugs.python.org/file20072/repr-3.patch ___ Python tracker <http://bugs.python.org/issue8

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-15 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : Added file: http://bugs.python.org/file20071/repr-2.patch ___ Python tracker <http://bugs.python.org/issue8753> ___ ___ Python-bugs-list m

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-15 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Good point. My perspective is skewed by all of the time that I spend working on container types. :-) How about if I change the first sentence to the following? Properly implementing :attr:`tp_repr` for container types requires special recursion

[issue10711] Rip out HTTP 0.9 support

2010-12-15 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: At minimum, I think we should apply this part of Antoine's patch: -# Most web servers default to HTTP 0.9, i.e. don't send a status line. -default_request_version = "HTTP/0.9" +default_request

[issue10711] Rip out HTTP 0.9 support

2010-12-15 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Would it be worth keeping (but modifying) test_http_0_9 to verify that the server complains in the expected way? -- nosy: +stutzbach ___ Python tracker <http://bugs.python.org/issue10

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-15 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : Attached is a patch to add documentation for Py_ReprEnter and Py_ReprLeave. Assigning to d...@python for review. -- assignee: stutzbach -> d...@python keywords: +needs review, patch nosy: +d...@python stage: needs patch -> patch review Adde

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

2010-12-14 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Would it be sufficient to: 1) Restrict collections.Set()'s operators to accept collection.Set but not arbitrary iterables, and 2) Fix Issue2226 and let set() | MySimpleSet() work via collections.Set.__ror__ Attached is a patch that implements this app

[issue2226] Small _abcoll Bugs / Oddities

2010-12-14 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Minor point of clarity: you mean __rand__ not __radd__, right? Set objects do not support addition at all. Adding the __rand__ methods to collections.Set in and of itself is straightforward: def __rsub__(self, other): return self

[issue8040] It would be nice if documentation pages linked to other versions of the same document

2010-12-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- versions: -Python 3.2 ___ Python tracker <http://bugs.python.org/issue8040> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-10 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: In bltinmodule.c, it looks like some of the indentation doesn't line up? Bikeshedding aside, it looks good to me. I agree with Eric Smith that the first part macro name usually refers to the type of the first argument (or the type the first argument p

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-07 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: +1 on the general idea of abstracting out repeated code. I will take a closer look at the details within the next few days. -- ___ Python tracker <http://bugs.python.org/issue10

[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

[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: > (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

[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

[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-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-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: 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

[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

[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

[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: +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
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

[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,

[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

[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

[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-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-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: 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: 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
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
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
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

[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

  1   2   3   4   5   >