RE: [Python-Dev] Rewriting PEP4

2004-12-07 Thread Raymond Hettinger
Instead, there should be a clear decision to deprecate or not. If that entails a comp.lang.python.announce notice and comment period, so be it. Once a decision is made, document it, add a warning, and wait. Ok, that might be reasonable. Please word the PEP accordingly. Once a couple

[Python-Dev] The other Py2.4 issue

2004-12-08 Thread Raymond Hettinger
Acceptance for Py2.4 partially hinges on how quickly third party apps have their binaries updated. I wonder if there is anything we can do to help. Raymond -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tuure Laurinolli Sent: Tuesday, December 07,

[Python-Dev] RE: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.300.8.10, 2.300.8.11

2004-12-17 Thread Raymond Hettinger
The Dec 12th check-ins break tests on WinME: test_glob.py Traceback (most recent call last): File test_glob.py, line 78, in test_glob_one_directory eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa'])) File test_glob.py, line 67, in assertSequencesEqual_noorder

RE: [Python-Dev] re: 2.4 news reaches interesting places

2004-12-17 Thread Raymond Hettinger
So how about a slogan like Code it Fast, with Python, or Python: Code Fast -- one which emphasizes the (easily defended) claim that development time is shorter with Python, but which at the same time manages to associate the word fast with Python. I always liked: Python, the language that

RE: [Python-Dev] Re: 2.4 news reaches interesting places

2004-12-10 Thread Raymond Hettinger
The Wiki entry seems to reinforce the impression that bugged Guido to begin with. It provides a bunch of but ... explanations about why Python's speed isn't that important. Python is slow, but speed of development is far more important. I felt the same way when reading it. Also, it seemed

RE: [Python-Dev] RE: [Python-checkins] python/dist/src/Modulesposixmodule.c, 2.300.8.10, 2.300.8.11

2004-12-18 Thread Raymond Hettinger
FWIW, the tests at issue pass on WinXP for me today w/ current CVS. Tests pass here too. Raymond ___ Python-Dev mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80

2004-12-20 Thread Raymond Hettinger
[Armin] Crash.  Which means that there is no way in 2.4.0 to marshal an object in the old version format as a string -- you'd have to work around by writing a real file and reading it back :-( [Aahz] Brown bag time? Perhaps a rather quick Py2.4.1 would be in order.   Ideally, it should

RE: [Python-Dev] Re:[Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80

2004-12-20 Thread Raymond Hettinger
Raymond Hettinger wrote: Perhaps a rather quick Py2.4.1 would be in order. Ideally, it should include other important fixes: [...] * Fix for off-by-one bug in urllib.URLopener.retrieve http://www.python.org/sf/810023 (assigned to me) Is http://www.python.org/sf/1062060

Re: [Python-Dev] Patch Reviewing

2004-12-31 Thread Raymond Hettinger
[Reinhold Birkenfeld] just felt a little bored and tried to review a few (no-brainer) patches. Thanks, please assign to me and I'll apply them. Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

RE: [Python-Dev] Let's get rid of unbound methods

2005-01-04 Thread Raymond Hettinger
[Guido van Rossum] Let's get rid of unbound methods. +1 [Jim Fulton] duck typing? Requiring a specific interface instead of a specific type. [Guido] Does anyone think this is a bad idea? [Jim] It *feels* very disruptive to me, but I'm probably wrong. We'll still need unbound

RE: [Python-Dev] an idea for improving struct.unpack api

2005-01-05 Thread Raymond Hettinger
suggest posting it as an ASPN recipe and then announcing it on comp.lang.python. That ought to generate some good feedback based on other people's real world issues with struct.unpack(). Raymond Hettinger ___ Python-Dev mailing list Python-Dev

RE: [Python-Dev] PEP 246, redux

2005-01-11 Thread Raymond Hettinger
manual adaption practices should change. For example, if I need a file-like interface to a string, I currently wrap it with StringIO. How will that change it the future? By an explicit adapt/conform pair? Or by strings knowing how to conform to file-like requests? Raymond Hettinger

RE: [Python-Dev] PEP 246: lossless and stateless

2005-01-13 Thread Raymond Hettinger
that they are providing. Using optional arguments may not be the most elegant or extensible approach. Perhaps a registry table or adapter attributes would fare better. Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http

RE: [Python-Dev] Updated Monkey Typing pre-PEP

2005-01-20 Thread Raymond Hettinger
[Guido van Rossum] There's one other problem that Phillip tries to tackle in his proposal: how to implement the rich version of an interface if all you've got is a partial implementation (e.g. you might have readline() but you need readlines()). I think this problem is worthy of a solution,

RE: [Python-Dev] state of 2.4 final release

2005-01-25 Thread Raymond Hettinger
[Anthony Baxter] I didn't see any replies to the last post, so I'll ask again with a better subject line - as I said last time, as far as I'm aware, I'm not aware of anyone having done a fix for the issue Tim identified ( http://www.python.org/sf/1069160 ) So, my question is: Is this

RE: [Python-Dev] state of 2.4 final release

2005-01-25 Thread Raymond Hettinger
[Anthony Baxter] I'm not aware of anyone having done a fix for the issue Tim identified ( http://www.python.org/sf/1069160 ) [Raymond Hettinger] Any chance of this getting fixed before 2.4.1 goes out in February? [Timbot] It probably won't be fixed by me. It would be better if a Unix

RE: [Python-Dev] Speed up function calls

2005-01-26 Thread Raymond Hettinger
I agree that METH_O and METH_NOARGS are near optimal wrt to performance. But if we could have one METH_UNPACKED instead of 3 METH_*, I think that would be a win. . . . Sorry, I meant eliminated w/3.0. So, leave METH_O and METH_NOARGS alone. They can't be dropped until 3.0 and they can't

RE: [Python-Dev] Patch review: [ 1009811 ] Add missing typesto__builtin__

2005-01-27 Thread Raymond Hettinger
[James Y Knight] Basically, I'd like to see them be given a binding somewhere, and have their claimed module agree with that, but am not particular as to where. Option #2 seemed to be rejected last time, and option #1 was given approval, so that's what I wrote a patch for. It sounds like

RE: [Python-Dev] list of constants - tuple of constants

2005-02-06 Thread Raymond Hettinger
[Neal] I think I implemented this once. I'll try to see if I can find a patch. It wasn't too difficult, but I'm not sure if the patch was clean. If the opportunity arises, another worthwhile peepholer buildout would be to recognize if-elif chains that can be transformed to a single lookup

[Python-Dev] RE: [Python-checkins] python/dist/src/Lib/test test_copy.py, 1.11.8.1, 1.11.8.2

2005-02-06 Thread Raymond Hettinger
Modified Files: Tag: release23-maint test_copy.py Log Message: fix bug 1114776 Don't forget release24-maint. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

[Python-Dev] Other library updates

2005-02-06 Thread Raymond Hettinger
Any objections to replacing the likes of types.IntType and types.ListType with int and list? Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

RE: [Python-Dev] Re: [Python-checkins] python/dist/src/Pythoncompile.c, 2.343, 2.344

2005-02-10 Thread Raymond Hettinger
(self, key) Raymond Hettinger ___ 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] A hybrid C Python implementation for itertools

2005-02-13 Thread Raymond Hettinger
[Nick Coghlan] If itertools was a hybrid module, the handy 3-4 liners could go in the Python section, with the heavy lifting done by the underlying C module. The Python equivalents to the current C code could also be placed in the hybrid module (as happens with some of the other hybrid

RE: [Python-Dev] [ python-Bugs-1124637 ] test_subprocess is far tooslow (fwd)

2005-02-17 Thread Raymond Hettinger
Let's keep the really long-running tests out of the regular test suite. For test_subprocess, consider adopting the technique used by test_decimal. When -u decimal is not specified, a small random selection of the resource intensive tests are run. That way, all of the tests eventually get run

[Python-Dev] Prospective Peephole Transformation

2005-02-17 Thread Raymond Hettinger
frozenset version of the patch, so I would like to get feedback on whether you guys think it is worth it. Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

RE: [Python-Dev] Re: Prospective Peephole Transformation

2005-02-18 Thread Raymond Hettinger
I'm unclear why the list in for x in [1,2,3] or if x not in [1,2,3] can't fairly easily be recognized as a constant and just be placed in the constants array. That part got done (at least for the if-statement). The question is whether the type transformation idea should be carried a step

RE: [Python-Dev] Prospective Peephole Transformation

2005-02-18 Thread Raymond Hettinger
Wouldn't it help a lot more if the compiler would detect that (1,2,3) is immutable and convert it into a constant at compile time ?! Yes. We've already gotten it to that point: . . . Cool. Does that work for all tuples in the program ? It is limited to just tuples of constants

RE: [Python-Dev] Prospective Peephole Transformation

2005-02-18 Thread Raymond Hettinger
I'm very glad you introduced the optimization of building small constant tuples at compile-time. IMO, that was a pure win. It's been out in the wild for a while now with no issues. I'm somewhat happy with it. the transformation isn't semantically correct on the face of it. Well that's

RE: [Python-Dev] Store x Load x -- DupStore

2005-02-21 Thread Raymond Hettinger
Where are the attempts to speed up function/method calls? That's an area where we could *really* use a breakthrough... At one time you had entertained treating some of the builtin calls as fixed. Is that something you want to go forward with? It would entail a from __future__ and transition

[Python-Dev] PEP 309

2005-02-26 Thread Raymond Hettinger
Paul Moore wrote: Personally, I'd rather see partial as it stands, with its current limitations, included.  The alternative seems to be a potentially long discussion, petering out without conclusion, and the whole thing missing Python 2.5. (I know that's a long way off, but this already

RE: [Python-Dev] PEP 309

2005-02-26 Thread Raymond Hettinger
But this all reminds me of the discussion over itemgetter/attrgetter. They also special-case particular uses of lambda, and in those cases the stated benefits were speed and (arguably) readability (I still dislike the names, personally). I wouldn't use those as justification for partial().

RE: [Python-Dev] PEP 309

2005-02-27 Thread Raymond Hettinger
Along the way, they should assess whether it is as applicable as expected, whether the existing limitations are problematic, and whether performance is an issue. Ah, so you question the specification, not the implementation of it. My only issue with the PEP is that it seemed much more

RE: [Python-Dev] PEP 309

2005-02-27 Thread Raymond Hettinger
[Martin] It seems to me that the patch will be committed shortly, assuming somebody corrects the remaining flaws in the implementation. I could do that, but I would prefer if somebody contributed an updated patch. Done. Raymond ___ Python-Dev

RE: [Python-Dev] Re: [Python Dev] PEP 309

2005-02-28 Thread Raymond Hettinger
[Peter Harris] I look forward to the day when I can just use it. You PEP is marked as final. The code has been checked in to CVS and will be in Py2.5. Congrats, Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http

RE: [Python-Dev] Decimal returning NotImplemented (or not)

2005-03-01 Thread Raymond Hettinger
A recent question on c.l.p pointed out that the 2.4 Decimal implementation raises TypeError directly for operator arguments it doesn't understand, instead of returning NotImplemented. Obviously, this creates problems for anyone trying to define a class that 'plays nicely' with Decimal

RE: [Python-Dev] Re: [Python Dev] PEP 309

2005-03-03 Thread Raymond Hettinger
Nick Coghlan writes: I'm actually half-tempted to suggest that [map, filter and reduce] should be aliased in the functional module for 2.5 (in addition to being in builtins - ala the contents of the exceptions module). Well, I think it's a good idea, so I'll formally propose it! Let's

RE: [Python-Dev] Re: [Python-checkins] python/dist/src/Misc NEWS, 1.1193.2.27, 1.1193.2.28

2005-03-03 Thread Raymond Hettinger
SF bug #1155938: Missing None check for __init__(). Won't this break working (but erroneous) code? If so, should it be applied to the 2.4 branch? Hmm, more than one poster found the error message to be helpful in detecting buggy code. The non-None return value was a pretty good indicator

[Python-Dev] itemgetter/attrgetter extension

2005-03-08 Thread Raymond Hettinger
(soldierdata, key=attrgetter('unit', 'rank', 'proficiency')) Raymond Hettinger ___ 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

RE: [Python-Dev] @deprecated (was: Useful thread project for 2.5?)

2005-03-08 Thread Raymond Hettinger
Michael Chermside suggested: import warnings def deprecated(func): This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emmitted when the function is used. def newFunc(*args, **kwargs):

RE: [Python-Dev] LinkedHashSet/LinkedHashMap equivalents

2005-03-09 Thread Raymond Hettinger
If I read the proposal correctly, order would be determined by when the key was first encountered. Presumably, that would mean that the related value would also be the first encountered (not overridden by later-added keys as dictated by your business requirements). Hm Guess

RE: [Python-Dev] LinkedHashSet/LinkedHashMap equivalents

2005-03-10 Thread Raymond Hettinger
ordereddict sees it. Raymond Hettinger ___ 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] Adding any() and all()

2005-03-10 Thread Raymond Hettinger
See my blog: http://www.artima.com/forums/flat.jsp?forum=106thread=98196 Do we even need a PEP or is there a volunteer who'll add any() and all() for me? I'll volunteer for this one. Will leave it open for discussion for a bit so that folks can voice any thoughts on the design. Raymond

RE: [Python-Dev] Adding any() and all()

2005-03-10 Thread Raymond Hettinger
implementation of and and or. Returning the last element is not evil; it's just weird, unexpected, and non-obvious. Resist the urge to get tricky with this one. Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http

RE: [Python-Dev] Adding any() and all()

2005-03-11 Thread Raymond Hettinger
BTW I definitely expect having to defend removing map/filter/reduce/lambda with a PEP; that's much more controversial because it's *removing* something and hence by definition breaking code. I suspect that lambda will be the only bone of contention. The reduce() function can be moved to the

[Python-Dev] sum()

2005-03-11 Thread Raymond Hettinger
[Alex] If you're considering revisions to sum's design, my suggestion would be to find a way to let the user tell sum to use a more accurate approach when summing floats. FWIW, when accuracy is an issue, I use: sum(sorted(data, key=abs)) Raymond

Re: [Python-Dev] sum()

2005-03-11 Thread Raymond Hettinger
[Alex] FWIW, when accuracy is an issue, I use: sum(sorted(data, key=abs)) ...and you may still lose a LOT of accuracy that way:-(. Raymond, you technically reviewed the 2nd ed Cookbook -- don't you recall the sidebar about why partials are the RIGHT way to do summations? I was SO

RE: [Python-Dev] sum()

2005-03-12 Thread Raymond Hettinger
(), key=abs), 0.0) The implementation can be tweaked to consume the error term right away so the queue won't grow by more than few pending items. Also, the speed can be boosted by localizing frexp, exp2sum.pop, and queue.append. Raymond Hettinger

RE: [Python-Dev] sum()

2005-03-12 Thread Raymond Hettinger
the queue can be expected to grow to about half the length of the original iterable by the time the original iterable is exhausted. x = z mant, exp = frexp(x) exp2sum[exp] = x return sum(sorted(exp2sum.itervalues(), key=abs), 0.0) The implementation

RE: [Python-Dev] comprehension abbreviation (was: Adding any() andall())

2005-03-13 Thread Raymond Hettinger
[GvR] - Before anybody asks, I really do think the reason this is requested at all is really just to save typing; there isn't the avoid double evaluation argument that helped acceptance for assignment operators (+= etc.), and I find redability is actually improved with 'for'. {Neil

[Python-Dev] itertools.walk()

2005-03-16 Thread Raymond Hettinger
through nested iterables (similar to what os.walk does for directories). The one wrinkle is having a stoplist argument to specify types that should be considered atomic eventhough they might be iterable (strings for example). Raymond Hettinger ___ Python-Dev

RE: [Python-Dev] sum()

2005-03-28 Thread Raymond Hettinger
[Tim] For contrast, here's one that doesn't use frexp(), and is probably faster because of that; internally, len(sums) probably won't exceed 5 in real life (but could get as large as 2K for pathological inputs, spanning fp's full dynamic range): def summer4(iterable): sums = [0.0]

RE: [Python-Dev] RELEASED Python 2.4.1 (final)

2005-03-30 Thread Raymond Hettinger
I'm happy to announce the release of Python 2.4.1 (final). Woohoo! Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

[Python-Dev] Developer list update

2005-04-05 Thread Raymond Hettinger
he can help manage outstanding bugs and patches. Raymond Hettinger ___ 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

RE: [Python-Dev] Developer list update

2005-04-08 Thread Raymond Hettinger
[Raymond Hettinger] Does anyone know what has become of the following developers and perhaps have their current email addresses? [Tim Peters] How about we exploit that if someone is a Python developer on SF, they necessarily have an SF email address ($(SFNAME)@users.sourceforge.net, like

RE: [Python-Dev] args attribute of Exception objects

2005-04-12 Thread Raymond Hettinger
, x) Traceback (most recent call last): File pyshell#12, line 2, in -toplevel- raise Boom(Value must be a five, x) Boom: ('Value must be a five', 10) Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

RE: [Python-Dev] Unified or context diffs?

2005-04-13 Thread Raymond Hettinger
[Nick Coghlan] Are context diffs still favoured for patches? The patch submission guidelines [1] still say that, but is it actually true these days? I personally prefer unified diffs, but have been generating context diffs because of what the guidelines say. Submit whichever is the most

RE: [Python-Dev] Caching objects in memory

2005-04-23 Thread Raymond Hettinger
*/ _PyUnicode_Fini(); #endif Raymond Hettinger ___ 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] atexit missing an unregister method

2005-04-26 Thread Raymond Hettinger
. Likewise, I suspect that exposing the stack will create more pitfalls and risks than it could provide in benefits. Dealing with a stack of functions is likely to be clumsy at best. Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org

[Python-Dev] Developer list update

2005-04-30 Thread Raymond Hettinger
I haven't heard back from Greg Stein, Jim Fulton, or Paul Prescod. If anyone can get in touch with them, that would be great. I suspect that Jim may want to keep the commit privileges active and that Paul and Greg are done with commits for the time being. Raymond Hettinger

RE: [Python-Dev] Developer list update

2005-04-30 Thread Raymond Hettinger
Thanks for the note. Let me know if you need to be switched on again at some point. Raymond Hettinger -Original Message- From: Paul Prescod [mailto:[EMAIL PROTECTED] Sent: Saturday, April 30, 2005 4:39 PM To: Raymond Hettinger Cc: python-dev@python.org Subject: Re: [Python-Dev

Re: [Python-Dev] PEP 340 -- concept clarification

2005-05-03 Thread Raymond Hettinger
I just made a first reading of the PEP and want to clarify my understanding of how it fits with existing concepts. Is it correct to say that continue parallel's its current meaning and returns control upwards (?outwards) to the block iterator that called it? Likewise, is it correct that yield is

Re: [Python-Dev] PEP 340 -- concept clarification

2005-05-03 Thread Raymond Hettinger
[Raymond] Likewise, is it correct that yield is anti-parallel to the current meaning? Inside a generator, it returns control upwards to the caller. But inside a block-iterator, it pushes control downwards (?inwards) to the block it controls. [Guido van Rossum] I have a hard time

Re: [Python-Dev] PEP 340 -- concept clarification

2005-05-03 Thread Raymond Hettinger
In contrast, the new use of yield differs in that the suspended frame transfers control from the encloser to the enclosed. Why does your notion of who encloses whom suddenly reverse when you go from a for-loop to a block-statement? This all feels very strange to me. After another reading

Re: [Python-Dev] PEP 340 -- concept clarification

2005-05-03 Thread Raymond Hettinger
it's not infeasible to add a close() method to generators as a shortcut for this: def close(self): try: self.__exit__(StopIteration) except StopIteration: break else: # __exit__() didn't raise RuntimeError(or

Re: [Python-Dev] PEP 340 -- concept clarification

2005-05-03 Thread Raymond Hettinger
I think that realization is important. It would be great to have a section of the PEP that focuses on separability and matching features to benefits. Start with above observation that the proposed examples can be achieved with generators driving the block statement. Good idea. I'm

Re: [Python-Dev] my first post: asking about a decorator module

2005-05-04 Thread Raymond Hettinger
in the standard library should be the last evolutionary step, not the first. Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python

Re: [Python-Dev] Breaking off Enhanced Iterators PEP from PEP 340

2005-05-06 Thread Raymond Hettinger
I'd be willing to break these off into a separate PEP if people think it's a good idea. I've seen very few complaints about any of these pieces of the proposal. If possible, I'd like to see these things approved now, so that the discussion could focus more directly on the

Re: [Python-Dev] The decorator module

2005-05-09 Thread Raymond Hettinger
*hate* it! Sounds reasonable. Choices: - submit a patch adding a __copy__ method to functions, - submit a patch for the copy module, or - submit a feature request, assign to me, and wait. Raymond Hettinger ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] [Python-checkins] python/nondist/peps pep-0343.txt, 1.8, 1.9

2005-05-14 Thread Raymond Hettinger
-was, under the covers, a (optential) looping construct. This +was, under the covers, a (potential) looping construct. This I'm glad I didn't fix this one. I thought he meant to use optional. Raymond Hettinger ___ Python-Dev mailing list

Re: [Python-Dev] Example for PEP 343

2005-05-17 Thread Raymond Hettinger
Raymond Hettinger ___ 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] Example for PEP 343

2005-05-17 Thread Raymond Hettinger
What's the advantage of using two calls to getcontext() vs. saving the context in a local variable? I prefer saving the context in a local variable but that is just a micro-optimization. The presentation with multiple calls to getcontext() was kept just to match the style of the original --

Re: [Python-Dev] Example for PEP 343

2005-05-17 Thread Raymond Hettinger
work with a copy. oldcontext = decimal.getcontext() newcontext = oldcontext.copy() newcontext.prec += 2 yield None decimal.setcontext(oldcontext) This approach defends against various kinds of unruly behavior by the yield target. Raymond Hettinger

Re: [Python-Dev] Example for PEP 343

2005-05-17 Thread Raymond Hettinger
I think you're missing a decimal.setcontext(newcontext) before the yield.. Right. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] [Python-checkins] python/nondist/peps pep-0343.txt, 1.11, 1.12

2005-05-17 Thread Raymond Hettinger
+def sin(x): +Return the sine of x as measured in radians. +do with_extra_precision(): +i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1 +while s != lasts: +lasts = s +i += 2 +

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325:generator exceptions and cleanup

2005-05-18 Thread Raymond Hettinger
Should this maybe just be added to PEP 342? To me, PEP 342 has always seemed incomplete without ways to throw() and close(), but that could easily be just me. In any case I'd expect the implementation of 'next(arg)' to have some overlap with the implementation of 'throw()'. Maybe, but

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generator exceptions and cleanup

2005-05-18 Thread Raymond Hettinger
Okay. Maybe we should just update PEP 325, then? -1. Keep this separate. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generatorexceptions and cleanup

2005-05-18 Thread Raymond Hettinger
[Raymond Hettinger] Are the value and traceback arguments optional as they are with the current raise statement? If they are optional, what would the default be? I think the preferred choice is to have the call to the throw method be the anchor point. That makes sense in a traceback so

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325:generator exceptions and cleanup

2005-05-18 Thread Raymond Hettinger
So at this point it seems your proposal is just nailing down specifics for the open parts of PEP 325. Or PEP 288? That has throw() (albeit with a different signature). I could do without the attributes though (PEP 342 provides a much better solution IMO). If either of those PEP

Re: [Python-Dev] Decimal construction

2005-05-19 Thread Raymond Hettinger
Not sure what the right answer is, but I wanted to stick my oar in to say that I think that Decimal has not been in the field long enough or widely-enough used that we should feel that the API has been set in stone. If there's agreement that a mistake was made, let's fix it! There is not

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325:generator exceptions and cleanup

2005-05-19 Thread Raymond Hettinger
BTW I think that close() and __del__() should raise an exception when the throw(GeneratorExit) call doesn't end up either re-raising GeneratorExit or raising StopIteration. The framework for calling __del__() takes care of handling this exception (by printing and then ignoring it). Raymond

Re: [Python-Dev] Adventures with Decimal

2005-05-19 Thread Raymond Hettinger
[Tim suggesting that I'm clueless and dazzled by sparkling lights] There seems to be an unspoken wow that's cool! kind of belief that because Python's Decimal representation is _potentially_ unbounded, the constructor should build an object big enough to hold any argument exactly (up to the

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Raymond Hettinger
I sense a religious fervor about this so go ahead and do whatever you want. Please register my -1 for the following reasons: a.) It re-introduces representation error into a module that worked so hard to overcome that very problem. The PEP explicitly promises that a transformation from a

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Raymond Hettinger
Addenda: j.) The same rules would need to apply to all forms of the Decimal contructor, so Decimal(someint) would also need to truncate/round if it has more than precision digits -- likewise with Decimal(fromtuple) and Decimal(fromdecimal). All are problematic. Integer conversions are expected

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Raymond Hettinger
Does it really need to be argued interminably that deviating from a standard is a Big Deal? The word deviate inaccurately suggests that we do not have a compliant method which, of course, we do. There are two methods, one context aware and the other context free. The proposal is to change

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Raymond Hettinger
[Michael Chermside] Frankly, I have no idea WHAT purpose is served by passing a context to the decimal constructor... I didn't even realize it was allowed! Quoth the docs for the Decimal constructor: The context precision does not affect how many digits are stored. That is determined

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Raymond Hettinger
[Guido] You know that, but Raymond seems confused. From one of his posts (point (k)): [Raymond] Throughout the implementation, the code calls the Decimal constructor to create intermediate values. Every one of those calls would need to be changed to specify a context. [Facundo] The

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Raymond Hettinger
It looks like if you pass in a context, the Decimal constructor still ignores that context: import decimal as d d.getcontext().prec = 4 d.Decimal(1.234567890123456789012345678901234567890123456789, d.getcontext()) Decimal(1.234567890123456789012345678901234567890123456789)

[Python-Dev] Decimal FAQ

2005-05-22 Thread Raymond Hettinger
Some of the private email I've received indicates a need for a decimal FAQ that would shorten the module's learning curve. A discussion draft follows. Raymond --- Q. It is cumbersome to type decimal.Decimal('1234.5'). Is there a way to

Re: [Python-Dev] Request for dev permissions

2005-05-28 Thread Raymond Hettinger
permissions. When you have a patch that is really to apply, upload it to the tracker and assign to me. Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org

Re: [Python-Dev] Request for dev permissions

2005-05-28 Thread Raymond Hettinger
Let's start out with CVS tracker permissions. When you have a patch that is really to apply, upload it to the tracker and assign to me. really -- ready ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Old Python version categories in Bug Tracker

2005-05-30 Thread Raymond Hettinger
As the process of deprecating old bugs evolves, the following categories got empty: Python 2.1.1 Python 2.1.2 Python 2.2.1 Python 2.2.1 candidate Python 2.2.2 That's great news. The SF interface doesn't allow to delete old categories, but maybe we could ask SF

Re: [Python-Dev] PEP 342/343 status?

2005-05-31 Thread Raymond Hettinger
If Raymond would rather defer to me, I can give it a shot in a revised version of PEP 343, Thanks, that would be great. The decimal conversation used up a lot of my available cycles. Raymond ___ Python-Dev mailing list Python-Dev@python.org

[Python-Dev] Closing old bugs

2005-06-02 Thread Raymond Hettinger
Old age and a missing OP is not sufficient reason to close a bug. But if closing a bug is an effective way of kicking things into life again... I'm seeing this effect in a lot of bugs I closed as old ones. That means they shouldn't have been closed and that we almost lost a valid

Re: [Python-Dev] Closing old bugs

2005-06-02 Thread Raymond Hettinger
I've seen some systems that solve this problem by allowing users to vote for favorite bugs... then you can tell the important bugs because they are more likely to have lots of votes. As I see it, Facundo is using a variant of that system. He is asking whether there is *ONE PERSON* out there

Re: [Python-Dev] [Python-checkins] python/dist/src/Lib sre_compile.py, 1.57, 1.58

2005-06-02 Thread Raymond Hettinger
(code, av[1], flags) if av[2]: The times two operation also occurs twice in nearby code. Are those also incorrect? Raymond Hettinger ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] Thoughts on stdlib evolvement

2005-06-06 Thread Raymond Hettinger
. Raymond Hettinger ___ 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] PEP 343 - next steps

2005-06-10 Thread Raymond Hettinger
- throw() is a term taken from Java C++. This was intended. There was much discussion about this for PEP 288 and this was more or less a concensus choice. The term is already associated with exceptions in other languages and it captures the concept of the raise occurring somewhere else (what

Re: [Python-Dev] Multiple expression eval in compound if statement?

2005-06-12 Thread Raymond Hettinger
I'm horsing around with recognizing switch-like if statements like: if x == 1: print 1 elif x == 2: print 2 else: print unknown in the compiler and generating O(1) code. x can be any expression, but must be precisely the same in each elif clause,

Re: [Python-Dev] Wishlist: dowhile

2005-06-13 Thread Raymond Hettinger
By the way, whatever happened to and while? That is making something hard and weird out of something simple. There were no shortage of odd suggestions to force the condition line to appear lower in the block than the starting line. All of them smelled of rotten eggs -- they just don't fit the

Re: [Python-Dev] Wishlist: dowhile

2005-06-13 Thread Raymond Hettinger
[BJörn Lindqvist] I would like to have do-while's like this: do: body until cond But I'm sure that has problems too. That looks nice to me. Raymond ___ Python-Dev mailing list Python-Dev@python.org

  1   2   3   4   5   6   7   8   9   10   >