Re: [Python-Dev] Decimal - float comparisons in py3k.

2010-03-16 Thread Raymond Hettinger
On Mar 16, 2010, at 9:41 AM, Guido van Rossum wrote: I'd say if you're not going to forward-port this to Python 3, it shouldn't go into Python 2 -- in that case it would make more sense to me to back-port the exception-raising behavior. Python 3 doesn't need it because it is possible to

Re: [Python-Dev] Deprecation warnings in Python 2.7

2010-03-02 Thread Raymond Hettinger
On Tue, Mar 2, 2010 at 15:55, Florent Xicluna florent.xicl...@gmail.com wrote: Hello, I would like to open a discussion on the meaning of deprecation warnings in 2.7. I assume, but I may be wrong, that 2.7 will be the last version in the 2.x branch. With this assumption, we should

Re: [Python-Dev] Python 2.6.5

2010-02-09 Thread Raymond Hettinger
On Feb 9, 2010, at 9:54 PM, anatoly techtonik wrote: Is it possible to make exploits out of crashers? The crashers involve creating convoluted python code, but then if you're in a position to execute arbitrary Python code, then you don't have to resort to any tricks to do something nasty

Re: [Python-Dev] Python 2.6.5

2010-02-02 Thread Raymond Hettinger
+1 On Feb 2, 2010, at 10:08 AM, Barry Warsaw wrote: I'm thinking about doing a Python 2.6.5 release soon. I've added the following dates to the Python release schedule Google calendar: 2009-03-01 Python 2.6.5 rc 1 2009-03-15 Python 2.6.5 final This allows us to spend some time on 2.6.5

Re: [Python-Dev] PEP 3147: PYC Repository Directories

2010-01-31 Thread Raymond Hettinger
On Jan 30, 2010, at 4:00 PM, Barry Warsaw wrote: Abstract This PEP describes an extension to Python's import mechanism which improves sharing of Python source code files among multiple installed different versions of the Python interpreter. +1 It does this by allowing many

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-27 Thread Raymond Hettinger
On Jan 27, 2010, at 11:38 AM, Martin v. Löwis wrote: Lists are indeed used *everywhere* and *vast* quantities, which is why optimizations on list operations are worthwhile to pursue. Unfortunately, the proposed change is a pessimisation, not an optimisation. We probably shouldn't discuss

Re: [Python-Dev] O(1) random access to deque? (Re: patch to make list.pop(0) work in O(1) time)

2010-01-27 Thread Raymond Hettinger
Are you free to chat about this in IRC? I completely unconvinced that there are use cases for wanting face random access to the i-th element of a large deque that is changing sizes on each end. The meaning of the 20th index changes as the data moves. It becomes pointless to store indices to

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-27 Thread Raymond Hettinger
On Jan 27, 2010, at 2:56 PM, Steve Howell wrote: --- On Wed, 1/27/10, Raymond Hettinger raymond.hettin...@gmail.com wrote: From: Raymond Hettinger raymond.hettin...@gmail.com Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time To: Martin v. Löwis mar...@v.loewis.de Cc

Re: [Python-Dev] O(1) random access to deque? (Re: patch to make list.pop(0) work in O(1) time)

2010-01-27 Thread Raymond Hettinger
On Jan 27, 2010, at 3:55 PM, Maciej Fijalkowski wrote: FWIW, deque indexing for small deques is already O(1) and somewhat fast. You only get O(n) degradation (with a small contant factor) on large deques. Hi. For small dequeues (smaller than a constant), you have to have O(1)

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Raymond Hettinger
Ah, but that applies for *large* lists. Adding 8 bytes to each list object applies to *all* lists. I betcha that many programs use many tiny lists. Even most tiny-ish lists are wasting memory, though, according to this sequence: 4, 8, 16, 25, ... That is only is they are being

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-25 Thread Raymond Hettinger
On Jan 25, 2010, at 11:22 AM, Steve Howell wrote: I am interested in creating a patch to make deleting elements from the front of Python list work in O(1) time by advancing the ob_item pointer. +1 on doing whatever experiments you feel like doing -1 on putting something like this in the core

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-25 Thread Raymond Hettinger
On Jan 25, 2010, at 12:36 PM, Steve Howell wrote: Deque does not support all the operations that list does. It is also roughly twice as slow for accessing elements (I've measured it). ISTM that apps that want to insert or pop from the front of list are also apps that don't care about

Re: [Python-Dev] PyPI comments and ratings, *really*?

2009-11-12 Thread Raymond Hettinger
[Jacob Kaplan-Moss] I've already started on a patch to make comments an option that package maintainers could turn on or off, but I don't want to waste any more time fighting this code unless I have some assurance it'll be checked in. I support your efforts. Raymond

Re: [Python-Dev] 2.7/3.2 release schedule

2009-11-10 Thread Raymond Hettinger
[Guido van Rossum] . We used to have releases once a year and we got really big serious feedback from our biggest users that the release cycle was going too fast. We discussed it amply and agreed on a minimum time of 18 months between releases. If the language moratorium goes into effect,

Re: [Python-Dev] 2.7/3.2 release schedule

2009-11-10 Thread Raymond Hettinger
[MvL] I personally think that decoupling the releases would be best, i.e. not start thinking about 3.2 for another 6 months. [Benjamin] The problem with that is that there is a period of time where 2.x has features which 3.x doesn't. My preference is to move back the whole schedule 6

Re: [Python-Dev] decimal.py: == and != comparisons involving NaNs

2009-11-08 Thread Raymond Hettinger
[Stefan Krah] in a (misguided) bugreport (http://bugs.python.org/issue7279) I was questioning the reasons for allowing NaN comparisons with == and != rather than raising InvalidOperation. Do you have any actual use case issues or are these theoretical musings? I ask only because a good use

Re: [Python-Dev] PEP 3003 - Python Language Moratorium

2009-11-05 Thread Raymond Hettinger
[GvR] I haven't seen substantial opposition against the PEP -- in fact I can't recall any, and many people have explicitly posted in support of it. So unless opposition suddenly appears in the next few days, I'll move it to the Accepted state next Monday. But it would have been so much fun to

Re: [Python-Dev] Retrieve an arbitrary element from a setwithoutremoving it

2009-11-05 Thread Raymond Hettinger
[Chris Bergstresser] Clearly, I'll need to write up the PEP. Why not write a short, fast get_first() function for your utils directory and be done with it? That could work with sets, mappings, generators, and other containers and iterators. No need to fatten the set/frozenset API for

Re: [Python-Dev] Retrieve an arbitrary element from asetwithoutremoving it

2009-11-05 Thread Raymond Hettinger
[me] Why not write a short, fast get_first() function for your utils directory and be done with it? That could work with sets, mappings, generators, and other containers and iterators. No need to fatten the set/frozenset API for something so trivial and so rarely needed. Forgot to post the

Re: [Python-Dev] Retrieve an arbitrary element from a setwithoutremoving it

2009-11-04 Thread Raymond Hettinger
[Steven D'Aprano] Anyway, given the level of opposition to the suggestion, I'm no longer willing to carry the flag for it. If anyone else -- perhaps the OP -- feels they want to take it any further, be my guest. [geremy condra] I've said before that I'd like there to be one, standard way of

Re: [Python-Dev] 2.7 Release? 2.7 == last of the 2.x line?

2009-11-03 Thread Raymond Hettinger
[Michael Foord] What will it take to *start* the port? (Or is it already underway?) For many projects I fear that it is only the impending obsolescence (real rather than theoretical) of Python 2 that will convince projects to port. FWIW, I do not buy into the several premises that have arisen

Re: [Python-Dev] Retrieve an arbitrary element from a setwithoutremoving it

2009-11-03 Thread Raymond Hettinger
Personally, I have found it useful in doco I write to have a section on Common Tasks, with recommended/suggested examples of how to do them and short rationale for the chosen method. It seems to me that if .pick() is frequently desired and None of the standard solutions are obvious or easily

Re: [Python-Dev] nonlocal keyword in 2.x?

2009-11-02 Thread Raymond Hettinger
[Guido van Rossum] I'm -0 on backporting nonlocal to 2.7. I could be +0 if we added from __future__ import nonlocal_keyword (or some such phrasing) to enable it. With the from __future__ option, what keeps you from being a full +1 on nonlocal? Is there something that makes it a better

Re: [Python-Dev] nonlocal keyword in 2.x?

2009-11-01 Thread Raymond Hettinger
As I said: Python 2 support is not only about supporting old versions of Python, but also supporting users of Python2-only modules. So 2.7 support will for the most part be a case not of supporting Python versions, but Python *users*. And contrary to what Antoine said, that *is* a good reason to

Re: [Python-Dev] Retrieve an arbitrary element from a setwithoutremoving it

2009-10-29 Thread Raymond Hettinger
[Steven D'Aprano] The suggested semantics for set.get() with no arguments, as I understand them, are: (1) it will only fail if the set is empty; Just like next() except that next() gives you the option to supply a default and can be used on any iterator (perhaps iter(s) or itertools.cycle(s)

Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Raymond Hettinger
[Chris Bergstresser] Still, I think my point stands--it's a clear extrapolation from the existing dict.get(). Not really. One looks-up a key and supplies a default value if not found. The other, set.get(), doesn't have a key to lookup. A dict.get() can be meaningfully used in a loop

Re: [Python-Dev] Retrieve an arbitrary element from a setwithoutremoving it

2009-10-27 Thread Raymond Hettinger
[geremy condra] Was it ever decided whether this would fall under the moratorium? Decided isn't the right word: http://mail.python.org/pipermail/python-dev/2009-October/093373.html FWIW, I'm a strong -1 on both proposals. Just add a short get_one() function and a get_equivalent() recipe to

Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-26 Thread Raymond Hettinger
[John Arbash Meine] So 'for x in s: break' is about 2x faster than next(iter(s)) and 3x faster than (iter(s).next()). The first version uses direct calls for the for-loop opcodes. The other two have to do functions/method look-up and make a pure python function call (neither is very fast).

Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-26 Thread Raymond Hettinger
Chris Bergstresser] I like the proposed set.get() method, personally. Sets have been implemented in many languages, but I've only seen one that implemented this functionality (the arb function in SETL). For the most part, it seems that this is an uncommon need. Also consider that

[Python-Dev] Set methods for mapping views

2009-10-26 Thread Raymond Hettinger
[GvR] I still wish we could go back in time and unify sets and dicts, if only to find out how that experiment would turn out. I'm curious about the outcome of another experiment along those lines. Is anyone seeing uptake for the set methods on mapping views in Py3.x? I haven't seen any code

Re: [Python-Dev] Set methods for mapping views

2009-10-26 Thread Raymond Hettinger
I'm curious about the outcome of another experiment along those lines. Is anyone seeing uptake for the set methods on mapping views in Py3.x? Next version of Graphine will use them heavily for graph merges and set operations on graphs. That's great! Thanks for the data point. I look

Re: [Python-Dev] Backport new float repr to Python 2.7?

2009-10-11 Thread Raymond Hettinger
[Mark Dickinson] - string to float *and* float to string conversions are both guaranteed correctly rounded in 3.x: David Gay's code implements the conversion in both directions, and having correctly rounded string - float conversions is essential to ensure that eval(repr(x)) recovers x

Re: [Python-Dev] Backport new float repr to Python 2.7?

2009-10-11 Thread Raymond Hettinger
[Glyph Lefkowitz ] This reasoning definitely makes sense to me; with all the dependency-migration issues 3.x could definitely use some carrots. However, I don't think I agree with it, because this doesn't feel like a big new feature, just some behavior which has changed. The

Re: [Python-Dev] transitioning from % to {} formatting

2009-10-08 Thread Raymond Hettinger
[Christian Tanzer] How do you suppose that maintainers could ever do the transition from %- to {}-formatting manually? [Guido van Rossum] This is pretty much the situation with integer division (you can only recognize it by running the code), Do you think there may be some possible

Re: [Python-Dev] transitioning from % to {} formatting

2009-10-02 Thread Raymond Hettinger
[Steven Bethard] . Just saying ok, switch your format strings from % to {} didn't work in Python 3.0 for various good reasons, and I can't imagine it will work in Python 4.0 unless we have a transition plan. Do the users get any say in this? I imagine that some people are heavily invested in

Re: [Python-Dev] transitioning from % to {} formatting

2009-10-02 Thread Raymond Hettinger
[Terry Reedy] I would agree, for instance, that an auto-translation tool is needed. We should get one written. ISTM, every %-formatting string is directly translatable to an equivalent {}-formatting string. Raymond ___ Python-Dev mailing list

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Raymond Hettinger
The positional parameter would also mean dicttemplate, and would be deprecated (eventually requiring a keyword-only parameter). Although I hate the name 'dicttemplate', this seems like the best solution to me. Maybe it's good that 'dicttemplate' is so ugly though so that people will naturally

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Raymond Hettinger
[Terry Reedy] However it is done, I think someone (like new Python programmers) should be able to program in Python3, and use everything in the stdlib, without ever learning % formatting -- and that I should be able to forget about it ;-). +10 on the goal. If that were possible, it would

Re: [Python-Dev] Python 2.6.3

2009-09-30 Thread Raymond Hettinger
[Sridhar Ratnakumar] 2.6.3rc1 builds fine on Linux x86/x86_64, MacOSX 10.4 ppc/x86, Windows 32bit/64bit, HP-UX, AIX and Solaris just like 2.6.2 did. Did the test suite pass too? Raymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Raymond Hettinger
I don't know -- this is (from what Peter told me) a common use case so he (and presumably others) would from time to time have to write extra code to keep track of that IP address in a new app. [MvL] I, and probably others, would really, REALLY like to see one such common use case. I do

Re: [Python-Dev] Misc/maintainers.rst

2009-09-17 Thread Raymond Hettinger
On Sep 17, 2009, at 10:59 AM, Brett Cannon wrote: On Thu, Sep 17, 2009 at 10:38, Georg Brandl g.bra...@gmx.net wrote: R. David Murray schrieb: I floated a proposal on stdlib-sig to create a file named Misc/maintainers.rst. The purpose of this file is to collect knowledge about who knows

Re: [Python-Dev] Numeric alignment issue with PEP 3101

2009-09-15 Thread Raymond Hettinger
And I sort of disagree with saying it's naturally left- or right- aligned; as numbers are naturally (decimal) dot-aligned (if you use dot to separate the whole and fractional part of your number). How about, naturally aligned by place value. Raymond

Re: [Python-Dev] Numeric alignment issue with PEP 3101

2009-09-07 Thread Raymond Hettinger
I concur. Numbers are naturally right aligned. On Sep 7, 2009, at 2:46 PM, Eric Smith wrote: The default string formatting alignment for all types, according to PEP 3101, is left aligned. Issue 6857 (http://bugs.python.org/issue6857 ) points out that for numeric types (int, float, and

Re: [Python-Dev] why different between staticmethod and classmethod on non-callable object?

2009-09-01 Thread Raymond Hettinger
On Sep 1, 2009, at 2:54 PM, Benjamin Peterson wrote: 2009/9/1 Brett Cannon br...@python.org: On Tue, Sep 1, 2009 at 07:21, Benjamin Petersonbenja...@python.org wrote: 2009/8/31 xiaobing jiang s7v7nisla...@gmail.com: My idea is: here, the two functions (or maybe classes) should have the

Re: [Python-Dev] default of returning None hurts performance?

2009-08-31 Thread Raymond Hettinger
I was just wondering if a bytecode for a superinstruction of the common sequence: 6 POP_TOP 7 LOAD_CONST 0 (None) 10 RETURN_VALUE might be worth it. [Collin Winter] I doubt it. You'd save a bit of stack manipulation, but since this will only appear at the end of a function, I'd be

Re: [Python-Dev] functools.compose to chain functions together

2009-08-16 Thread Raymond Hettinger
[Antoine Pitrou] I also think it would be a nice addition. (but someone has to propose a patch :-)) I agree with Martin's reasons for rejecting the feature request (see the bug report for his full explanation). IIRC, the compose() idea had come-up and been rejected in previous discussions

Re: [Python-Dev] random number generator state

2009-08-15 Thread Raymond Hettinger
[Scott David Daniels] I find I have a need in randomized testing for a shorter version of getstate, even if it _is_ slower to restore. When running exhaustive tests, a failure report should show the start state of the generator. Unfortunately, our current state includes a 625-element array.

Re: [Python-Dev] [RELEASED] Python 3.1 final

2009-06-27 Thread Raymond Hettinger
On behalf of the Python development team, I'm thrilled to announce the first production release of Python 3.1. Sweet! Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] draft pep: backwards compatibility

2009-06-19 Thread Raymond Hettinger
Not sure why we need yet another pep on the subject. Just update PEP 5 if needed. Also, I think there is a certain amount of wishful thinking here. Ideally, we could approve a tiny PEP with just a few bullet points and it would eliminate the need for all of the complicated decision making

Re: [Python-Dev] Iterator version of contextlib.nested

2009-06-15 Thread Raymond Hettinger
I don't consider changing a DeprecationWarning to a PendingDeprecationWarning resurrecting its target. Seems like resurrection to me. Pending warnings are hidden by default, so someone has to go look for it (and no one does this). The problem with the nested() construct is not so much that it

Re: [Python-Dev] Iterator version of contextlib.nested

2009-06-14 Thread Raymond Hettinger
FWIW, I think resurrecting contextlib.nested() is a bad idea. Part of the justification for the new with-statement syntax was that nested() doesn't have a way to finalize the constructors if one of them fails. It is a pitfall for the unwary. And now that we have the new with-statement syntax,

Re: [Python-Dev] FINAL PROPULSION OPEN SOURCE ENGINE VARIANT FORTHE F-35 JOINT STRIKE FIGHTER

2009-06-12 Thread Raymond Hettinger
[Matthew Wilkes] Oh, I didn't mean they should use proprietary software, just that in my experience the kind of people who are active in open source are quite anti-war, green, etc. There are notable exceptions, but I know people who worry that their work will have military applications,

Re: [Python-Dev] Adding key and reverse args to bisect

2009-06-11 Thread Raymond Hettinger
[David A. Barrett] I propose adding the key parameter to the bisect.bisect routines. This would allow it to be used on lists with an ordering other than the one natural to the contained objects. Algorithmically, the bisect routines are the wrong place to do key lookups. If you do many calls

Re: [Python-Dev] Status of 2.7 and 3.2

2009-06-07 Thread Raymond Hettinger
How about we just continue to improve both branches, doing forward or backports as appropriate. No need to develop a policy of crippling one branch on the theory that it will make the other seem more attractive. Besides, if 2.7 and 3.2 get released within a few months of each other, any

Re: [Python-Dev] Issues with Py3.1's new ipaddr

2009-06-03 Thread Raymond Hettinger
[GvR] Whoa. Are you all suddenly trying to turn Python into a democracy? Arthur: I am your king! Woman: Well I didn't vote for you! Arthur: You don't vote for kings. Woman: Well how'd you become king then? [Angelic music plays...] Arthur: The Lady of the Lake, her arm clad in the purest

Re: [Python-Dev] Issues with Py3.1's new ipaddr

2009-06-03 Thread Raymond Hettinger
[GvR] Benjamin, what would be involved in removing it? I suppose there's the module itself, some unit tests, and some docs. (I'm not asking you to remove it yet -- but I'm asking to look into the consequences, so that we can be sure to do the right thing before releasing 3.1 final.) [Benjamin

Re: [Python-Dev] Issues with Py3.1's new ipaddr

2009-06-02 Thread Raymond Hettinger
We could remove it, but then what we have wouldn't really be a release candidate anymore, so the release would get delayed. Not true. There is a second release candidate scheduled on June 13th. Removing the module involves doing svn remove on two files and updating Misc/NEWS. Yesterday, there

[Python-Dev] Issues with Py3.1's new ipaddr

2009-06-01 Thread Raymond Hettinger
In http://bugs.python.org/issue3959 , Clay McClure is raising some objections to the new ipaddr.py module. JP Calderone shares his concerns. I think they were the only commenters not directly affiliated with one of the competing projects. The issues they've raised seem serious, but I don't

Re: [Python-Dev] Two proposed changes to float formatting

2009-04-26 Thread Raymond Hettinger
it would make more sense to me if it stayed fixed at 56 sig digits for numbers larger than 1e50. So I agree with this, even if the default # of sig digits were less. Several reasons to accept Mark's proposal: * It matches what C does and many languages tend to copy the C standards

[Python-Dev] Tuples and underorderable types

2009-04-24 Thread Raymond Hettinger
Does anyone have any ideas about what to do with issue 5830 and handling the problem in a general way (not just for sched)? The basic problem is that decorate/compare/undecorate patterns no longer work when the primary sort keys are equal and the secondary keys are unorderable (which is now

Re: [Python-Dev] Tuples and underorderable types

2009-04-24 Thread Raymond Hettinger
Would it make sense to provide a default ordering whenever the types are the same? This doesn't work when they are not the same :-) _ ~ @ @ \_/ Instead, you could make the decorating a bit more sophisticated: decorated = [(key, id(value), value) for key, value in blah(values)] or

Re: [Python-Dev] Tuples and underorderable types

2009-04-24 Thread Raymond Hettinger
I would discourage use of the decorate/sort/undecorate pattern, and encourage use of the key= argument. Or, if you really need to decorate into a tuple, still pass a key= argument. The bug report was actually about the sched module which used heapq to prioritize tuples consisting of times,

Re: [Python-Dev] Dropping bytes support in json

2009-04-09 Thread Raymond Hettinger
[Antoine Pitrou] Besides, Bob doesn't really seem to care about porting to py3k (he hasn't said anything about it until now, other than that he didn't feel competent to do it). His actual words were: I will need some help with 3.0 since I am not well versed in the changes to the C API or

Re: [Python-Dev] Dropping bytes support in json

2009-04-08 Thread Raymond Hettinger
We're in the process of forward-porting the recent (massive) json updates to 3.1, and we are also thinking of dropping remnants of support of the bytes type in the json library (in 3.1, again). This bytes support almost didn't work at all, but there was a lot of C and Python code for it

Re: [Python-Dev] slightly inconsistent set/list pop behaviour

2009-04-07 Thread Raymond Hettinger
[Tennessee Leeuwenburg ] Now, I know that sets aren't ordered, but... foo = set([1,2,3,4,5]) bar = [1,2,3,4,5] foo.pop() will reliably return 1 while bar.pop() will return 5 discuss :) If that's what you need: http://code.activestate.com/recipes/576694/ Raymond

Re: [Python-Dev] pyc files, constant folding and borderline portability issues

2009-04-06 Thread Raymond Hettinger
+1 for removing constant folding for floats (besides conversion of -literal). There are just too many things to worry about: FPU rounding mode and precision, floating-point signals and flags, effect of compiler flags, and the potential benefit seems small. If you're talking about the

Re: [Python-Dev] Getting values stored inside sets

2009-04-03 Thread Raymond Hettinger
[Nick Coghlan] It doesn't quite work the way RDM desribed it - he missed a step. Thanks for the clarification. We ought to write-out the process somewhere in a FAQ. It may also be instructive to step through the recipe that answers the OP's original request,

Re: [Python-Dev] PyDict_SetItem hook

2009-04-02 Thread Raymond Hettinger
The measurements are just a distractor. We all already know that the hook is being added to a critical path. Everyone will pay a cost for a feature that few people will use. This is a really bad idea. It is not part of a thorough, thought-out framework of container hooks (something that

Re: [Python-Dev] PyDict_SetItem hook

2009-04-02 Thread Raymond Hettinger
on the subject bug you, I'll happily withdraw from the thread. I don't aspire to be a source of negativity. I just happen to think this proposal isn't a good idea. Raymond - Original Message - From: Guido van Rossum gu...@python.org To: Raymond Hettinger pyt...@rcn.com Cc: Thomas Wouters

Re: [Python-Dev] PyDict_SetItem hook

2009-04-02 Thread Raymond Hettinger
It seems weird to me that Collin's group can be working so hard just to get a percent or two improvement in specific cases for pickling while python-dev is readily entertaining a patch that slows down the entire language. [Antoine Pitrou] I think it's really more than a percent or two:

Re: [Python-Dev] __length_hint__

2009-04-02 Thread Raymond Hettinger
Iterators can implement a method called __length_hint__ that provides a hint to certain internal routines (such as list.extend) so they can operate more efficiently. As far as I can tell, __length_hint__ is currently undocumented. Should it be? This has been discussed, and no, it is a

Re: [Python-Dev] PyDict_SetItem hook

2009-04-01 Thread Raymond Hettinger
John Ehresman wrote: * To what extent should non-debugger code use the hook? At one end of the spectrum, the hook could be made readily available for non-debug use and at the other end, it could be documented as being debug only, disabled in python -O, not exposed in the stdlib to python

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-24 Thread Raymond Hettinger
Agreed, and more importantly, I have yet to be convinced that those NULL checks introduce a measurable slowdown. Daniel, have you tried measuring the performance difference with only the NULL checks removed? I think it highly unlikely that there is a performance difference. These tend to

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-24 Thread Raymond Hettinger
4% on a micro-micro-benchmark is hardly compelling... I concur! This is utterly insignificant and certainly does not warrant removing the checks. -1 on these sort of fake optimizations. We should focus on algorithmic improvements and eliminating redundant work and whatnot. Removing checks

[Python-Dev] MutableSet and Set named methods

2009-03-24 Thread Raymond Hettinger
Does anyone remember the reason that most of the named methods were omitted from the ABC for mutablesets and sets? The update() method in particular would be nice to have. RAymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-24 Thread Raymond Hettinger
4% on a micro-micro-benchmark is hardly compelling... I concur! This is utterly insignificant and certainly does not warrant removing the checks. -1 on these sort of fake optimizations. We should focus on algorithmic improvements and eliminating redundant work and whatnot. Removing checks

Re: [Python-Dev] Core projects for Summer of Code

2009-03-19 Thread Raymond Hettinger
Another thought: it would be nice is pydoc were built-out with an alternate html generator that emitted clean, simple html with the appropriate div/span tags so that CSS can be used to control formatting. Right now, all of the formatting and color coding is in-line. If you don't like the

Re: [Python-Dev] Core projects for Summer of Code

2009-03-18 Thread Raymond Hettinger
As a project maintainer I wouldn't want an intern being the most familiar person with our Py3 migration, I'd rather students stick with new features or optimization and coordinate the migration process as a group-wide effort. Without help, it is going to take a long time to get many

Re: [Python-Dev] what's new in 3.1 anyone?

2009-03-18 Thread Raymond Hettinger
[Benjamin Peterson] It seems Andrew will be doing What's new in Python 2.7? again, but we don't seem to have a volunteer to do the 3.1 version? Would anyone like to volunteer? I'll pick-up this responsibility. Raymond ___ Python-Dev mailing list

[Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
Does anyone think it was not a good idea to put in-place operations in the operator module? For some objects, they don't map() as well as their regular counterparts. Some in-place operations rely on the interpreter to take care of the actual assignment. I've not yet seen good use cases for

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
Right. Since Python doesn't have a notation like operator + for turning operators into functions, the operator module provides this functionality. Better safe than sorry. It doesn't really expose this functionality because some of the functionality is buried in ceval.c and is not exposed by

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
Maybe someone somewhere has some interesting use for these in-place operator function. I hope so. It could be important if you want apply it to mutable objects, i.e. where the assignment doesn't do anything. I give up. My original question was whether anyone thought these were a good

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
[Martin v. Löwis] I would object to their removal, though, because it would hurt my sense of symmetry. I wasn't going to propose removal. If everyone had agreed that the operator in-place functions were problematic, I was going to suggest moving their docs to a second page and documenting

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-12 Thread Raymond Hettinger
[Lie Ryan] How about having a country code field, e.g. en-us would format according to US locale, in to India, ch to China, etc... that way the format string would become very simple (although the lib maintainer would need to know customs from all over the world). Then have a special country

Re: [Python-Dev] [Python-ideas] Rough draft: Proposed format specifier for a thousands separator (discussion moved from python-dev)

2009-03-12 Thread Raymond Hettinger
and Eric Smith --- PEP: XXX Title: Format Specifier for Thousands Separator Version: $Revision$ Last-Modified: $Date$ Author: Raymond Hettinger python at rcn.com Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 12-Mar-2009

Re: [Python-Dev] [Python-ideas] Rough draft: Proposed formatspecifier for a thousands separator (discussion moved frompython-dev)

2009-03-12 Thread Raymond Hettinger
Fixed typo in the example with spaces and commas. Discussion draft at: http://www.python.org/dev/peps/pep-0378/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

[Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Raymond Hettinger
The current formatting mini-language provisions left/right/center alignment, prefixes for 0b 0x 0o, and rules on when to show the plus-sign. I think it would be far more useful to provision a simple way of specifying a thousands separator. Financial users in particular find the locale approach

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Raymond Hettinger
[James Y Knight] You might be interested to know that in India, the commas don't come every 3 digits. In india, they come every two digits, after the first three. Thus one billion = 1,00,00,00,000. How are you gonna represent *that* in a formatting mini-language? :) It is not the goal to

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Raymond Hettinger
[Guido van Rossum] I suggest moving this to python-ideas and writing a proper PEP. Okay, it's moved. Will write up a PEP, do research on what other languages do and collect everyone's ideas on what to put in the shed. (hundreds and ten thousands grouping, various choices of decimal

Re: [Python-Dev] Decimal in C status (was Re: draft 3.1 releaseschedule)

2009-03-10 Thread Raymond Hettinger
[Nick Coghlan] What about decimal-in-C, by the way? Is anyone still working on it? I'm seeking funding for the project. If it is forthcoming, I intend to do a pure C version that simply implements the spec and then adds wrappers for the pure python interface. That will save the cost of

Re: [Python-Dev] Deprecated __cmp__ and total ordering

2009-03-10 Thread Raymond Hettinger
[Mart Sõmermaa] To provide total ordering without __cmp__ one has to implement all of __lt__, __gt__, __le__, __ge__, __eq__ and __ne__. However, in all but a few cases it suffices only to provide a real implementation for e.g. __lt__ and define all the other methods in terms of it as follows:

Re: [Python-Dev] Deprecated __cmp__ and total ordering

2009-03-10 Thread Raymond Hettinger
: [Raymond Hettinger] FWIW, I'm working on a solution for the problem using class decorators. The idea is that it would scan a class and fill-in missing methods based on the ones already there. That way, any one of the four ordering relations can be provided as a starting point and we won't have

Re: [Python-Dev] RELEASED Python 3.1 alpha 1

2009-03-09 Thread Raymond Hettinger
On behalf of the Python development team and the Python community, I'm happy to announce the first alpha release of Python 3.1. Are there any plans for a Windows installer? Raymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] draft 3.1 release schedule

2009-03-09 Thread Raymond Hettinger
You might also want to collect a list of serious changes that you want in this release; Bob Ippolito has a good sized patch to update the json module and improve its performance. http://bugs.python.org/issue4136 Raymond ___ Python-Dev

Re: [Python-Dev] draft 3.1 release schedule

2009-03-09 Thread Raymond Hettinger
You might also want to collect a list of serious changes that you want in this release; I'm making minor updates to the decimal module to match the 1.68 version of the spec. Raymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] draft 3.1 release schedule

2009-03-09 Thread Raymond Hettinger
I'm making minor updates to the decimal module to match the 1.68 version of the spec. Looks like most was already done. Just needs some doc fixes. Raymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Integrate BeautifulSoup into stdlib?

2009-03-08 Thread Raymond Hettinger
This is precisely the reason why I want Python to continue including its batteries. If we give that up, it will not come back, and users get frustrated that they have to collect stuff from many places, and that the stuff doesn't fit together completely. I concur. Raymond

Re: [Python-Dev] Forgotten Py3.0 change to remove Queue.empty() and Queue.full()

2009-03-07 Thread Raymond Hettinger
[MvL] At this point, I do request that the patch is reverted completely (i.e. that the documentation is restored), and that the qualification not reliable! is removed from the doc strings of the methods, as it is factually incorrect. I would be happy to restore the documentation. You want

Re: [Python-Dev] Forgotten Py3.0 change to remove Queue.empty() andQueue.full()

2009-03-07 Thread Raymond Hettinger
[MvL] At this point, I do request that the patch is reverted completely (i.e. that the documentation is restored), and that the qualification not reliable! is removed from the doc strings of the methods, as it is factually incorrect. I would be happy to restore the documentation. You want

Re: [Python-Dev] RELEASED Python 3.1 alpha 1

2009-03-07 Thread Raymond Hettinger
[Benjamin Peterson] On behalf of the Python development team and the Python community, I'm happy to announce the first alpha release of Python 3.1. Thanks for the good work. Raymond ___ Python-Dev mailing list Python-Dev@python.org

<    1   2   3   4   5   6   7   8   9   10   >