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

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 http://mail.python.org/mailman/lis

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

2009-03-10 Thread Raymond Hettinger
and memory allocations. Without addressing those, I think decimal will remain critically performance challenged compared to native floats (decimals will never be that fast, but they can get close enough to make them a viable alternative for many kinds of work).

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

2009-03-10 Thread Raymond Hettinger
to annoint one like __lt__ as the one true underlying method. When it's ready, I'll bring it to python-dev for discussion. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubs

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

2009-03-10 Thread Raymond Hettinger
s of it as follows: [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 poi

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

2009-03-10 Thread Raymond Hettinger
at to call it (total_ordering is one possibilty) and where to put it (functools is a possibility). Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/optio

[Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Raymond Hettinger
to be frustrating and non-obvious. Putting in a thousands separator is a common task for output destined to be read by non-programmers. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

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

2009-03-11 Thread Raymond Hettinger
possible use case. My pocket calculators all support thousands separators but in Python, we have to do a funky dance for even this most basic bit of formatting. I'd like to think that in 2009 we could show a little progress beyond C's printf() or Fortran's write() formats.

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

2009-03-11 Thread Raymond Hettinger
f decimal points, mayan number systems and whatnot). Will start with Nick's simple proposal as a starting point. [Nick Coghlan] [[fill]align][sign][#][0][minimumwidth][,][.precision][type] Other suggestions and comments welcome. Raymond ___ Pyt

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

2009-03-11 Thread Raymond Hettinger
other day. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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
ed suggestions by Lie Ryan and Eric Smith --- PEP: XXX Title: Format Specifier for Thousands Separator Version: $Revision$ Last-Modified: $Date$ Author: Raymond Hettinger Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 12-

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: http://mail.python.org/mail

[Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
cases for operator.isub() for example. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
never should have been (IMO). It wastes the time of people who try to use them and then find-out that they don't act as expected (the assignment doesn't take place) or that you can't use them with containers s[k] += x etc.) Maybe someone somewhere has some interesting use for

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
idea. Look's like the answer is yes, everyone is happy with the functions and are glad they were added in 2.5. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] In-place operators

2009-03-17 Thread Raymond Hettinger
they are. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2009-03-18 Thread Raymond Hettinger
would much rather this sort of work than having a student build a new library module and then not be around to maintain it. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

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 __

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

2009-03-19 Thread Raymond Hettinger
e the appearance of the output, the module is unusable. This is likely a two to three day project, easy and fun. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pytho

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-24 Thread Raymond Hettinger
s, it will be harder to know whether the issue is with the extension or with us. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-d

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-24 Thread Raymond Hettinger
that were put there for a reason doesn't seem useful at all. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%4

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

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-24 Thread Raymond Hettinger
oops whose cost is heavily due to array access are common. I thought people used PyList_GET_ITEM or something similar in those use situations. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

Re: [Python-Dev] PyDict_SetItem hook

2009-04-01 Thread Raymond Hettinger
code may lead to a severe performance penalty. This is especially true for set and get operations. See my comments in http://bugs.python.org/issue5654 Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pyt

Re: [Python-Dev] PyDict_SetItem hook

2009-04-02 Thread Raymond Hettinger
would need a PEP at the very least).The case for how it helps us is somewhat thin. The case for DTrace hooks was much stronger. If something does go in, it should be #ifdef'd out by default. But then, I don't think it should go in at all. Raymond On Thu, Apr 2, 2009 at 0

Re: [Python-Dev] PyDict_SetItem hook

2009-04-02 Thread Raymond Hettinger
hts 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" To: "Raymond Hettinger

Re: [Python-Dev] PyDict_SetItem hook

2009-04-02 Thread Raymond Hettinger
whole language. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] __length_hint__

2009-04-02 Thread Raymond Hettinger
Yes. BTW, the same rule also applies to __len__. IIRC, Tim proposed to add that to the docs somewhere. Perhaps Raymond can shed some light on these. Can't guess the future of __length_hint__(). Since it doesn't have a slot, the attribute lookup can actually slow down cases wi

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

2009-04-03 Thread Raymond Hettinger
Hrvoje Niksic wrote: I've stumbled upon an oddity using sets. It's trivial to test if a value is in the set, but it appears to be impossible to retrieve a stored value, See: http://code.activestate.com/recipes/499299/ Raymond ___

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

2009-04-03 Thread Raymond Hettinger
each inside any function or container to retrieve the "other" value that is equivalent to "self". Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2009-04-06 Thread Raymond Hettinger
ts written-out to a PyFloat object and is squeezed back into a C double (potentially introducing double-rounding if extended precision had be used by the FPU). Disabling the peepholer doesn't change this situation. Raymond ___ Python-Dev mailing list P

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/

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

2009-04-08 Thread Raymond Hettinger
g, once again, that bytes support is already broken in the current py3k trunk). +1 Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2009-04-09 Thread Raymond Hettinger
s responsive to detailed patch review. He gave a popular talk at PyCon less than two weeks ago. He's not derelict. I can understand that you don't want to spend much time on it. How about removing it from 3.1? We could re-add it when long-term support becomes

[Python-Dev] Tuples and underorderable types

2009-04-24 Thread Raymond Hettinger
ver the types are the same? def object.__lt__(self, other): if type(self) == type(other): return id(self) < id(other) raise TypeError Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

Re: [Python-Dev] Tuples and underorderable types

2009-04-24 Thread Raymond Hettinger
ult comparisons. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Tuples and underorderable types

2009-04-24 Thread Raymond Hettinger
of it. Cheers, Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2009-04-26 Thread Raymond Hettinger
e e-notation. The xmlrpc spec only accepts decimal expansions not %e notation. * The programmer needs to have some way to spell-out a decimal expansion when needed. Currently, %f is the only way. Raymond ___ Python-Dev mailing list Pytho

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

2009-06-01 Thread Raymond Hettinger
on was too rushed (see David Moss's comment on the tracker and later comments by Antoine Pitrou). Does anyone here know if Clay's concern about subnets vs netmasks in accurate and whether it affects the usability of the module? Raymond ___ Pyt

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

2009-06-02 Thread Raymond Hettinger
EWS. Yesterday, there was a conversation on IRC (including the RM) where it was discussed. So, in the unlikely event that Guido changes his mind, there is still time to do so. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

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 s

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

2009-06-03 Thread Raymond Hettinger
l.) [Benjamin Peterson] As Raymond and Gregory have pointed out in this thread, the library is quite independent as it stands now in the stlib, so should be trivial to remove. Nothing else should be affected. Guido, have you made a firm decision to remove ipaddr.py from 3.1? The guys on IRC are

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

2009-06-07 Thread Raymond Hettinger
3k branch. Probably, it is best to continue with that practice lest we muck-up his merge/block entries. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.o

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

2009-06-11 Thread Raymond Hettinger
1), ('yellow', 8), ('black', 0)] data.sort(key=lambda r: r[1])# key function called exactly len(data) times keys = [r[1] for r in data] data[bisect_left(keys, 0)] ('black', 0) data[bisect_left(keys, 1)] ('blue', 1) data[bisect_left(keys

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

2009-06-12 Thread Raymond Hettinger
Forge ;-) Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2009-06-14 Thread Raymond Hettinger
known to be problematic. Leaving it in will enshrine it. Better to just provide our new syntax that correctly handles the common case and then wait to carefully think through how to add support for passed-in nested cm's if in-fact those turn-out to have reasonable use cases.

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

2009-06-15 Thread Raymond Hettinger
ng the idea to change the DeprecationWarning to a PendingDeprecationWarning, but I don't think we're doing the users any favors by hiding the warning message. Raymond P.S. If you switch to PendingDeprecationWarning, the example in the docs should probably be switched to show the one valid use

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

2009-06-19 Thread Raymond Hettinger
oint in a general purpose process PEP. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-05 Thread Raymond Hettinger
eError else 0 # default to zero for empty sequences It would also be helpful in calculations that have algebraic restrictions: sample_std_deviation = sqrt(sum(x - mu for x in seq) / (len(seq)-1)) except ZeroDivisionError else float('Inf') Raymond __

Re: [Python-Dev] random number generator state

2009-08-15 Thread Raymond Hettinger
ut a recipe there for a long period generator, http://code.activestate.com/recipes/576707/ , but there doesn't seem to have been any real interest in generators with longer periods than MT. Raymond ___ Python-Dev mailing list Python-Dev@python.org

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

2009-08-16 Thread Raymond Hettinger
ether. IMO, its only virtue is that people coming from functional languages are used to having compose. Otherwise, it's a YAGNI. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

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

2009-08-31 Thread Raymond Hettinger
'd be skeptical that this would make any macrobenchmarks (statistically) significantly faster. I concur with Collin. And since it appears only at the end of a function, the optimization doesn't help inner-loops in a function (where most of the time usually sp

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

2009-09-01 Thread Raymond Hettinger
I fail to understand this crude logic. If a function contains any looping (C or otherwise) or does much in the way of meaningful work, then it's unlikely that the single POP_TOP associated with an implied "return None" is taking much of the total runt

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 : On Tue, Sep 1, 2009 at 07:21, Benjamin Peterson wrote: 2009/8/31 xiaobing jiang : My idea is: here, the two functions (or maybe classes) should have the same behavior). so is this a bug or something I missing ?

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 decim

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

2009-09-14 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&q

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

2009-09-17 Thread Raymond Hettinger
t have to look up what tracker name someone uses since I know everyone's committer name. +1 from me also. This has long been a source of irritation. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/lis

Re: [Python-Dev] thinking about 2.7

2009-09-23 Thread Raymond Hettinger
[Michael Foord] Are we definitely decided that 2.7 will be the last major release in the 2.x cycle? ISTM, that would depend on the uptake for 3.2. The users get a say in the matter. Raymond ___ Python-Dev mailing list Python-Dev@python.org http

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

2009-09-30 Thread Raymond Hettinger
nd the desire to have all formatting support both ways, but I don't think it is worth the costs. People *never* need both ways though they may have differing preferences about which *one* to use. my-two-cents, Raymond ___ Python-Dev mailing

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

2009-09-30 Thread Raymond Hettinger
frequently have to lookup the syntax and need to experiment with the interactive interpreter to get it right. I haven't found it easy to teach or to get other people to convert. This is especially true if the person has encountered %-formatting in other languages (it is a popular appro

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 http

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Raymond Hettinger
any of the competing packages ever found a need to add support for this yet-to-be-presented use case: http://code.google.com/p/netaddr/wiki/YetAnotherPythonIPModule Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

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

2009-10-01 Thread Raymond Hettinger
[Vinay Sajip] And the special wrappers needn't be too intrusive: __ = BraceMessage logger.debug(__("Message with {0} {1}", 1, "argument")) It looks like the BraceMessage would have to re-instantiate on every invocation. Raymond _

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

2009-10-02 Thread Raymond Hettinger
it as the preferred syntax. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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-10-08 Thread Raymond Hettinger
ng is that in most cases (things like the logging API excluded) you can change it one format string at a time. I've already have some code that mixes the styles (using {} for new stuff). Raymond ___ Python-Dev mailing list Python-Dev@pytho

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

2009-10-11 Thread Raymond Hettinger
Python source. There's no shortage of conversion bugs in the wild, and certainly bugs have been observed in OS X, Linux and Windows. (The ones I found in OS X 10.5 have been fixed in OS X 10.6, though.) Nice win. Thoughts? +1 I've worked with the 3.1 fl

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 c

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

2009-10-26 Thread Raymond Hettinger
you've retrieved an arbitrary element without removing it, then successive calls to "choose" could potentially retrieve the exact same element again and again. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.pytho

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

2009-10-26 Thread Raymond Hettinger
ot;iter(s).next()" is probably clearest, and at least will throw a StopIteration exception if the set is empty. "for x in s: break" is just confusing ... A short comment would do wonders. Raymond P.S. It is weird that this thread is gaining traction at the s

[Python-Dev] Set methods for mapping views

2009-10-26 Thread Raymond Hettinger
n any code using it, nor any bug reports or documentation requests, nor any code in the ASPN cookbook, nor mention of it on the newsgroup or python-help. Has anyone here seen any hints about how this is faring in the wild? Raymond ___ Python-Dev ma

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

2009-10-26 Thread Raymond Hettinger
nt. I look forward to reading the code. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2009-10-27 Thread Raymond Hettinger
in a loop (because the key can vary). A set.get() returns the same value over and over again (because there is no key). Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.

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

2009-10-27 Thread Raymond Hettinger
recipe to your utils directory. That will get the job done (thought I don't expect that you will *ever* make much use of either one). No need to complexify a type that is currently very simple. Raymond P.S. get_equivalent: http://code.activestate.com/recipes/499299/ get

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

2009-10-29 Thread Raymond Hettinger
but it actual implementation it will make sets more difficult to learn and it would quickly become a piece of rarely used, poorly understood cruft. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pyth

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

2009-11-01 Thread Raymond Hettinger
backport it. FWIW, I support backporting the nonlocal-keyword in 2.7. All of the reasons for introducting nonlocal to 3.x also apply to 2.x. Using the nonlocal keyword in clear and explicit, especially when compared to the existing workarounds which are not pretty. Raymond

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

2009-11-02 Thread Raymond Hettinger
ng that makes it a better solution for 3.x than 2.x? Just curious about the pros and cons from your point of view. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.p

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

2009-11-03 Thread Raymond Hettinger
their decision to stay with 2.x, or switch to 3.x, or try to support both. We should not muck with their rational decision making by putting "carrots" in one pile and abandoning the other. Raymond P.S. I found it curious that one of the strongest proponents of killing 2.x also mentio

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

2009-11-03 Thread Raymond Hettinger
vious or easily discoverable" then they should be _made_ so with documentation. Comments? That's reasonable. It's in the same category as people who can't figure-out how to clear a list because they forgot about slice notation. Raymond

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

2009-11-04 Thread Raymond Hettinger
no sense) 6) absence of real-world code examples that would be meaningfully improved I would be happy to add an example to the docs so that this thread can finally end. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.o

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

2009-11-05 Thread Raymond Hettinger
so much fun to have a never ending python-ideas thread on BEGIN/END blocks ;-) C'est la vie, Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailma

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

2009-11-05 Thread Raymond Hettinger
API for something so trivial and so rarely needed. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2009-11-05 Thread Raymond Hettinger
rable): 'Return the first value from a container or iterable. If empty, raises LookupError' for value in iterable: return value raise LookupError('no first value; iterable is empty') If desired, it is not hard to change to the last time to return a default value or some o

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

2009-11-08 Thread Raymond Hettinger
s the full behaviors specified by the standard, they need to use the actual compare() method which allows for a decimal context to be specified and allows for more than just a true/false return value (i.e. a NaN is a possible result). Raymond ___ Pytho

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

2009-11-10 Thread Raymond Hettinger
, would shorter release cycles still have a negative impact? Do people possibly want slower changes to the language and faster updates to the library? I don't know the answer. Just asking how this matches up with the feedback you have gotten previously. Ra

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

2009-11-10 Thread Raymond Hettinger
onths. My preference is to decouple and let 2.7 go out 18 months after 2.6. In general, 2.x users should not have to pay a price for whatever we do with 3.x. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/lis

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 eff

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 cor

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

2010-01-25 Thread Raymond Hettinger
27;abc') s.pop(0) print s[i] # i no longer points at 'abc' Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2010-01-26 Thread Raymond Hettinger
from the front and back. In comparison, the proposed changes to lists seem like a complete hack. Just because it can be done, doesn't mean that it should. ISTM that you're attacking an already solved problem and that you're playing fast and loose with a core data structure. Ra

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

2010-01-27 Thread Raymond Hettinger
m better than it does now but not as well as a deque which never has to move data). Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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
data structure? Raymond On Jan 27, 2010, at 1:50 PM, Nick Coghlan wrote: > Steve Howell wrote: >> There is also the possibility that my initial patch can be refined by >> somebody smarter than myself to eliminate the particular tradeoff. >> In fact, Antoine Pitrou already

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 wrote: > >> From: Raymond Hettinger >> Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time >> To: "Martin v. Löwis" >> Cc: "Steve Ho

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 ha

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

2010-01-31 Thread Raymond Hettinger
s besides tidiness. It hides the implementation details of when magic numbers get shifted. And it may allow faster start-up times when the zipfile is in the disk cache. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python

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

Re: [Python-Dev] Python 2.6.5

2010-02-09 Thread Raymond Hettinger
something nasty within the scope of your user permissions. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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