Re: [Python-Dev] len(chr(i)) = 2?

2010-11-21 Thread Raymond Hettinger
MP consume 2 bytes and count as one char for purposes of len and slicing. - Characters above the BMP consume 4 bytes and counts as two distinct chars for purpose of len and slicing. For wide builds, all characters are 4 bytes and count as a single char for len and slicing. Hope this helps, Ra

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-22 Thread Raymond Hettinger
On Nov 22, 2010, at 2:48 AM, Stephen J. Turnbull wrote: > Raymond Hettinger writes: > >> Neither UTF-16 nor UCS-2 is exactly correct anyway. > > From a standards lawyer point of view, UCS-2 is exactly correct, You're twisting yourself into definitional knots. Any ex

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-22 Thread Raymond Hettinger
e who take the time to > read the standard or otherwise learn what the term means. Bingo! Thanks for the excellent summary of the problem. > > What Python does might be called USC-2+ or UCS-2e (xtended). That would be a step in the right direction. Raymond ___

Re: [Python-Dev] constant/enum type in stdlib

2010-11-23 Thread Raymond Hettinger
gram Java in Python. IMO, adding a new enumeration type would make this situation worse. Also, it adds weight to the language -- Python is not in needs of yet another fundamental construct. Raymond P.S. I do recognize that lots of people have written their own versions of Enum(), but I th

Re: [Python-Dev] constant/enum type in stdlib

2010-11-27 Thread Raymond Hettinger
the __new__() takes exactly 3 arguments > (2 given). Can I suggest that an enum-maker be offered as a third-party module rather than prematurely adding it into the standard library. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://

Re: [Python-Dev] Discussion on Lib/test/crashers/

2006-07-10 Thread Raymond Hettinger
hence in a temporarily invalid state. Avoid using get_referrers() for any purpose other than debugging." Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org

Re: [Python-Dev] "Missing" 2.5 feature

2006-07-10 Thread Raymond Hettinger
ng beta are illusory. In this case, practicality beats pedantry.  For the users, it is a net win if this goes in. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org

Re: [Python-Dev] "Missing" 2.5 feature

2006-07-10 Thread Raymond Hettinger
t. You work is appreciated and your decisions are respected. I'm just suggesting a shift in emphasis to where the risks are. For the users, it is a net win if this goes in. In the case of this feature, that's true. It seems we're thinking a

Re: [Python-Dev] get for lists and tuples?

2006-07-11 Thread Raymond Hettinger
the waters. If it's not heresy then I'd like to >do what I can to make it happen. > > Perhaps in an alternate universe ;-) 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

[Python-Dev] Strategy for converting the decimal module to C

2006-07-18 Thread Raymond Hettinger
performance will be disappointing. my-two-cents, Raymond P.S. The dictionary approach to context objects should likely be abandoned for the C version. If the API has to change a bit, then so be it. ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-18 Thread Raymond Hettinger
Aahz wrote: On Tue, Jul 18, 2006, Raymond Hettinger wrote: P.S. The dictionary approach to context objects should likely be abandoned for the C version. If the API has to change a bit, then so be it. Why do you say that? The rest I agree with; seems to me that making

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-18 Thread Raymond Hettinger
Lisandro Dalcin wrote: On 7/18/06, Tim Peters <[EMAIL PROTECTED]> wrote: [Raymond Hettinger] ... If the current approach gets in their way, the C implementers should feel free to make an alternate design choice. I expect they will, even

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-19 Thread Raymond Hettinger
then use a dict subclass that overrides each of the mutating methods. Even then, we need to drop the concept of having the flags as counters rather than booleans. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.o

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-19 Thread Raymond Hettinger
Tim Peters wrote: ... [Raymond] Even then, we need to drop the concept of having the flags as counters rather than booleans. [Georg Brandl] Yes. Given that even Tim couldn't imagine a use case for counting the exceptions, I think it'

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-26 Thread Raymond Hettinger
ot be expected to work on other implementations of the standard (including a planned CPython extension module). Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pyth

[Python-Dev] Py2.5 release schedule

2006-07-27 Thread Raymond Hettinger
code as possible. That would have detected the recently surfaced grammar error a little bit earlier (the one where "for x, in listOfTuples" would not unpack). The release process itself is going well but I don't think the pervasive AST changes have been fully shaken

Re: [Python-Dev] Py2.5 release schedule

2006-07-28 Thread Raymond Hettinger
implementation decisions for str.rpartition(). This weekend, I'll run the head on a few third-party packages to see if their test-suites still pass -- if not, it would be nice to have a bit of time to fix whatever arises. Raymond ___ Python-Dev m

Re: [Python-Dev] Rounding float to int directly (Re: struct module and coercing floats to integers)

2006-07-31 Thread Raymond Hettinger
Greg Ewing wrote: >As an aside, does anyone else think that it would be >useful to have a builtin which rounds and converts to >an int in one go? Whenever I use round(), I almost >always want the result as an int, and making me do >it in two steps seems unnecessarily bothersome. > > I think this

Re: [Python-Dev] Rounding float to int directly ...

2006-08-01 Thread Raymond Hettinger
r floating-point, and there are plenty of other solutions for fixed-point. People who care about the accuracy of calculations prefer binary, as it is a more accurate model. That isn't a big deal, either. Hogwash.  The only issues with decimal are ease-of-use and s

Re: [Python-Dev] Rounding float to int directly (Re: struct module and coercing floats to integers)

2006-08-02 Thread Raymond Hettinger
w variant of round(). Also, -10 on changing the semantics of int() to round instead of truncate. The truncating version is found is so many other languages and book examples, that it would be a disaster for us to choose a different meaning. Raymond

Re: [Python-Dev] zip -> izip; is __length_hint__ required?

2006-08-27 Thread Raymond Hettinger
of suppressing exceptions.     Raymond From: [EMAIL PROTECTED] on behalf of Guido van RossumSent: Thu 8/24/2006 4:08 PMTo: Raymond Hettinger; python-dev@python.org; Brian HolmesSubject: zip -> izip; is __length_hint__ required? At today's sprint, Brian Holmes contributed a

[Python-Dev] Py2.5 issue: decimal context manager misimplemented, misdesigned, and misdocumented

2006-08-29 Thread Raymond Hettinger
py().get_manager() as ctx: ctx.prec += 2 s = ... return +s This is horrid. Please either revert the patch or fix it to match PEP-343. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pyth

Re: [Python-Dev] Py2.5 issue: decimal context manager misimplemented, misdesigned, and misdocumented

2006-08-29 Thread Raymond Hettinger
Raymond Hettinger wrote: >I would like to see the changes to the decimal module reverted for the >Py2.5 release. > >Currently, the code in the decimal module implements the context manager >as a separate class instead of incorporating it directly in >decimal.Context. >

Re: [Python-Dev] Py2.5 issue: decimal context manager misimplemented, misdesigned, and misdocumented

2006-08-29 Thread Raymond Hettinger
Phillip J. Eby wrote: > At 05:20 PM 8/29/2006 -0700, Raymond Hettinger wrote: > >> * The implementation's doc string examples were not tested and don't >> work (this is a deep error). One reads: >> >> with decimal.getcontext() as ctx: >>

Re: [Python-Dev] Py2.5 issue: decimal context manager misimplemented, misdesigned, and misdocumented

2006-08-30 Thread Raymond Hettinger
Nick Coghlan wrote: > Raymond Hettinger wrote: > >> I would like to see the changes to the decimal module reverted for >> the Py2.5 release. > > > I believe you may be overreacting - I don't consider the current > behaviour buggy and the module level API can

Re: [Python-Dev] Py2.5 issue: decimal context manager misimplemented, misdesigned, and misdocumented

2006-08-30 Thread Raymond Hettinger
be sure to also update the docs.  They currently reflect the __context__ approach. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/pyt

Re: [Python-Dev] Py2.5 issue: decimal context manager misimplemented, misdesigned, and misdocumented

2006-08-31 Thread Raymond Hettinger
Nick Coghlan wrote: > Raymond Hettinger wrote: > >> The right way to do it was presented in PEP343. The implementation >> was correct and the API was simple. > > > Raymond's persuaded me that he's right on the API part at the very > least. The current

Re: [Python-Dev] Py2.5 issue: decimal context manager misimplemented, misdesigned, and misdocumented

2006-09-01 Thread Raymond Hettinger
to _ContextManager() * make the trivial updates the whatsnew25 example Once those nits are fixed, I recommend this patch be backported to the Py2.5 release. 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

[Python-Dev] Problem withthe API for str.rpartition()

2006-09-01 Thread Raymond Hettinger
d line = 'a.b.c.d' while line: line, sep, field = line.rpartition('.') print field The second fragment never terminates. Since this is a critical API flaw rather than a implementation bug, I think it should get fixed right away rather than waiting for

Re: [Python-Dev] Py2.5 issue: decimal context manager misimplemented, misdesigned, and misdocumented

2006-09-02 Thread Raymond Hettinger
[Neal] > Please review the patch and make a comment. I did a diff between HEAD > and 2.4 and am fine with this going in once you are happy. I fixed a couple of documentation nits in rev 51688. The patch is ready-to-go. Nick, please go ahead and backport. R

Re: [Python-Dev] Fwd: Problem withthe API for str.rpartition()

2006-09-05 Thread Raymond Hettinger
Jim Jewett wrote: > >Why not just change which of the three strings holds the remainder in >the not-found case? > > That was the only change submitted. Are you happy with what was checked-in? Raymond ___ Python-Dev mailing

Re: [Python-Dev] Fwd: Problem withthe API for str.rpartition()

2006-09-05 Thread Raymond Hettinger
" or "rest" terminology is more appropriate for the part of the string that may still contain separators. 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] Fwd: Problem withthe API for str.rpartition()

2006-09-05 Thread Raymond Hettinger
use the function when making succesive partitions. 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] Fwd: Problem withthe API for str.rpartition()

2006-09-05 Thread Raymond Hettinger
> > Then shouldn't rpartition be S.rpartition(sep) -> (rest, sep, tail) Gads, the cure is worse than the disease. car and cdr are starting to look pretty good ;-) Raymond ___ Python-Dev mailing list Python-Dev@python.org http://m

Re: [Python-Dev] Fwd: Problem withthe API for str.rpartition()

2006-09-05 Thread Raymond Hettinger
lready thinking in terms of parsing from the end of the string. Another thought is that strings don't really have a left and right. They have a beginning and end. The left/right or top/bottom distinction is culture specific. Raymond BTW, if someone chops your ankles, does it matter which

Re: [Python-Dev] Fwd: Problem withthe API for str.rpartition()

2006-09-05 Thread Raymond Hettinger
#x27;) 'a'.rpartition('x') --> ('', '', 'a') This was necessary so that looping/recursion would work and so that rpartition() acts as a mirror-image of partition(). Raymond ___ Python-Dev ma

Re: [Python-Dev] Fwd: Problem withthe API for str.rpartition()

2006-09-05 Thread Raymond Hettinger
separator if found * the unchopped remainer of the string (which may contain a separator). Of course, if a clear example is added, the choice of words becomes much less important. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mai

Re: [Python-Dev] Fwd: Problem withthe API for str.rpartition()

2006-09-05 Thread Raymond Hettinger
:   'www.python.org'.rpartition('.') --> ('www.python', '.', 'org') Also, be sure to check with Neal or Anthony.  Since this is just a documentation nit, it may need to wait for Py2.5.1.  Ideally, we should only be making critical bugfixes and A

Re: [Python-Dev] Unicode Imports

2006-09-08 Thread Raymond Hettinger
given change will help more than it hurts. The RMs are also strongly biased against extensive patches than haven't had a chance to go through a beta-cycle -- they don't want their releases mucked-up. Raymond ___ Python-

Re: [Python-Dev] Suggestion for a new built-in - flatten

2006-09-22 Thread Raymond Hettinger
cover inputs with tree-like data structures with data at nodes as well as the leaves (preorder, postorder, inorder traversal, etc.) I say use your favorite cookbook approach and leave it out of the language. Raymond ___ Python-Dev mailing list

Re: [Python-Dev] weakref enhancements

2006-09-28 Thread Raymond Hettinger
served by a simple decorator, and that an expanding weakref zoo will only making the module more difficult to learn. 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] weakref enhancements

2006-09-28 Thread Raymond Hettinger
> Also, I question the utility of maintaining a weakref to a method or > attribute instead of holding one for the object or class. Strike that paragraph -- the proposed weakattrs have references away from the object, not to the object. R

Re: [Python-Dev] weakref enhancements

2006-09-28 Thread Raymond Hettinger
erencing assignment was made explicit rather than hiding the weak-referencing wrapper in a descriptor. 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] weakref enhancements

2006-09-28 Thread Raymond Hettinger
thods bound weakly to the underlying object, where the underlying can be deleted while the bound method persists, alive but unusable? Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] PEP 315 - do while

2006-10-04 Thread Raymond Hettinger
I'll mark it as withdrawn. Raymond -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Hylton Sent: Wednesday, October 04, 2006 8:44 AM To: Guido van Rossum Cc: Hans Polak; python-dev@python.org Subject: Re: [Python-Dev] PEP 315 - do while On 10

Re: [Python-Dev] 2.4.4: backport classobject.c HAVE_WEAKREFS?

2006-10-06 Thread Raymond Hettinger
No need to backport. Py_TPFLAGS_DEFAULT implies Py_TPFLAGS_HAVE_WEAKREFS. The change was for clarity -- most things that have the weakref slots filled-in will also make the flag explicit -- that makes it easier on the brain when verifying code that checks the weakref flag. Raymond

Re: [Python-Dev] 2.4.4: backport classobject.c HAVE_WEAKREFS?

2006-10-10 Thread Raymond Hettinger
is > that all these flags don't really mean "I have such and such > feature" but just "I could have such and such > feature, if the corresponding tp_xxx field were set". I would like to see that cleaned-up for Py3k. Ide

Re: [Python-Dev] Python 2.5 performance

2006-10-12 Thread Raymond Hettinger
patches or build compatible extensions. 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

[Python-Dev] Nondeterministic long-to-float coercion

2006-10-19 Thread Raymond Hettinger
s, but the magnitude of the error is so large that that seems implausible. Does anyone have a clue what is going-on? Raymond Python 2.4.2 (#1, Mar 29 2006, 11:22:09) [GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2 Type "help", "

Re: [Python-Dev] Nondeterministic long-to-float coercion

2006-10-19 Thread Raymond Hettinger
80.0 >>> -194 * (1/100.0) -19400.0 >>> -194 * (1/100.0) -19400.0 Raymond -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 1:44 PM To: Raymond Hettinger Cc: python-dev@python.org Subject: Re: [P

Re: [Python-Dev] a feature i'd like to see in python #1: betteriteration control

2006-12-05 Thread Raymond Hettinger
actively inserting and deleting entries, can introduce unexpected feedback between loop control and the loop body. This is a recipe for bugs and hard-to-maintain code. Overall, feature #1 is a non-starter and hopefully this thread will die quickly or move off-list. Raymond ___

Re: [Python-Dev] About dictionary lookup caching

2006-12-19 Thread Raymond Hettinger
do this ordering > of co_names at compile time It would be nice if you could avoid introducing a new invariant that would be have to be maintained by other code generation tools or bytecode hacks. Raymond ___ Python-Dev mailing list P

Re: [Python-Dev] PropertyType

2006-12-24 Thread Raymond Hettinger
[Michael Foord] > Could / should 'PropertyType' be added to the types module ? PropertyType = property Yawn, Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsub

Re: [Python-Dev] Bug or not? Different behaviour iterating list andcollections.deque

2007-01-08 Thread Raymond Hettinger
f the test for StopIteration versus the test for RuntimeError. The question is whether I can swap the test order without introducing other anomalies. Raymond P.S. The patch would look like this: Index: collectionsmodule.c ===

Re: [Python-Dev] [Python-3000] Warning for 2.6 and greater

2007-01-10 Thread Raymond Hettinger
de does not have to entail dulling the trusty old blade. 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-3000] Warning for 2.6 and greater

2007-01-10 Thread Raymond Hettinger
s almost never been of use for code updates.. It is easier and more comprehensive to grep for backticks or for calls to "coerce" than to run code and hope that every code path gets exercised. Raymond ___ Python-Dev mailing list Python-D

Re: [Python-Dev] [Python-3000] Warning for 2.6 and greater

2007-01-10 Thread Raymond Hettinger
sappearing, encoded text objects, real division and whatnot; that notion may be a pipe-dream. As far as "reassurance that it won't be that bad to migrate", screens full of warnings may be less than reassuring. Raymond ___ Python-Dev mailing li

Re: [Python-Dev] The bytes type

2007-01-12 Thread Raymond Hettinger
r (by limiting me to the intersection of the feature sets). I think we should draw a line in the sand and resolve not to garbage-up Py2.6. The whole Py3.0 project is about eliminating cruft and being free of the bonds of backwards compatibility. Adding non-essential cruft to Py2.6 goes against th

[Python-Dev] Proposed 3.0 compatiblity module

2007-01-12 Thread Raymond Hettinger
ep for them. If you don't care about 3.0 compatibilty, just don't import the module. Outside of a compatibility module, we can decide to leave Py2.6 unmolested by Py3.0, so I can stop being cranky. Raymond ___ Python-Dev mailing list P

[Python-Dev] Floor division

2007-01-19 Thread Raymond Hettinger
simpler and faster: return PyFloat_FromDouble(floor(a/b)); 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

Re: [Python-Dev] Shortcut Notation for Chaining Method Calls

2007-02-04 Thread Raymond Hettinger
multiple methods that can meaningfully be chained together in an arbitrary order. It is telling that the example chooses to call the reverse method when it could have simple chosen the reverse=True argument to sort(). Raymond ___ Python-Dev mail

Re: [Python-Dev] Adding timeout option to httplib...connect()

2007-02-08 Thread Raymond Hettinger
ion > of the socket. > > Does anybody else think this is a good idea? (Personally I think this > should've been done years ago. :-) Shall I check it into the head? Yes. This is has been requested more than once, but no one ever got around to a

Re: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-08 Thread Raymond Hettinger
[MvL] >>>>> 1. For 2.5.1, rewrite slot_nb_inplace_power to raise an exception >>>>> if the third argument is not None, and then invoke __ipow__ with only one >>>>> argument. [Raymond] >> Why would you change Py2.5? There is no bug here.

Re: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-12 Thread Raymond Hettinger
classes). IOW, getattr(a,n) is not always the same as a.__dict__[n]. The a.__getattribute__(n) process can be more complex than that and a bracketed dictionary-like syntax would misleadingly mask the lookup process. Raymond ___ Python-Dev maili

Re: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-12 Thread Raymond Hettinger
[Raymond Hettinger] >> Rather than munge existing syntaxes, an altogether new one would be >> more clear: >> >>self->name = self.metadata->name [Ben North] > One thing which comes to mind about this one is that, for C/C++ > programmers, the difference bet

[Python-Dev] Py2.6 ideas

2007-02-15 Thread Raymond Hettinger
* Teach vars() to work with classes defining __slots__. Essentially, __slots__ are just an implementation detail designed to make instances a bit more compact. * Make the docstring writable for staticmethods, classmethods, and properties. We did this for function objects and it worked-out well.

Re: [Python-Dev] [Python-3000] UserDict revamp

2007-02-15 Thread Raymond Hettinger
> On 2/15/07, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> I would like to be the one to migrate it to Py3.0. [Steve] > No complaints here. Not that you need my permission of course. ;-) Thanks, I had already started working on this one. Of course, everyone is wel

Re: [Python-Dev] Py2.6 ideas

2007-02-15 Thread Raymond Hettinger
[Raymond Hettinger] >>> * Add a pure python named_tuple class to the collections module. >>> I've been using the class for about a year and found that it greatly >>> improves the usability of tuples as records. >>> http://aspn.activestate.com/ASPN/Cookboo

Re: [Python-Dev] Py2.6 ideas

2007-02-16 Thread Raymond Hettinger
Of course, that specific example was solved long ago. We did not however expose a general purpose mechanism applicable where similar issues arise for other tuples. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/l

Re: [Python-Dev] Py2.6 ideas

2007-02-16 Thread Raymond Hettinger
> Raymond Hettinger schrieb: >> d, g, v, t, r = model(somecontract) [MvL] > I find that line quite unreadable Of course, I can't give you the fully spelled-out line from proprietary code. But at this point we're just talking about the use cases for tuples with or without n

Re: [Python-Dev] Py2.6 ideas

2007-02-19 Thread Raymond Hettinger
ision isn't central to the proposal and is still an open question. The __module__ idea is nice. Will add it. Likewise with pickling. The 'show' part of __repr__ was done for speed (localized access versus accessing the enclosing scope. Will rename it to _show to make it clear

Re: [Python-Dev] Py2.6 ideas

2007-02-19 Thread Raymond Hettinger
now to make it more clear and added a docstring. The idea was the some use cases require that the repr exactly match the default style for tuples and the optional argument allowed for that possiblity with almost no performance hit. The updated recipe is at http://

Re: [Python-Dev] Py2.6 ideas

2007-02-20 Thread Raymond Hettinger
the optional argument allowed for that >> possiblity with almost no performance hit. > > But what about simply changing the __repr__? . . . > In [4]: Point.__repr__ = tuple.__repr__ Okay, that is the better way. Raymond ___ Python-Dev mailing lis

[Python-Dev] Py_ssize_t

2007-02-20 Thread Raymond Hettinger
real problem. Have all major third-party extensions adopted Py_ssize_t or is some divine force helping unconverted extensions work with converted Python code? Maybe the datasets just haven't gotten big enough yet. Raymond ___ Python-Dev mail

Re: [Python-Dev] Py_ssize_t

2007-02-20 Thread Raymond Hettinger
culprit. I had remembered the PEP saying that there might be some issues for non-upgraded third-party modules and have wondered whether others were similarly affected. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.o

Re: [Python-Dev] [Python-3000] PEP 3113 (Removal of Tuple Parameter Unpacking)

2007-03-04 Thread Raymond Hettinger
ses. Until csv and sql start returning records with field name attributes instead of tuples, we'll need something like we have now. Also attribute access has performance issues compared to tuple unpacking (sad fact of life). Raymond ___ Python-

Re: [Python-Dev] Encouraging developers

2007-03-05 Thread Raymond Hettinger
address it. Even with a tests and docs, patch acceptance is far from automatic. That being said, I think history has shown that important bugs get addressed and put into bug fix releases without much loss of time. When Py2.5.1 goes out, I expect that all known, important

[Python-Dev] Fwd: Re: Encouraging developers

2007-03-07 Thread Raymond Hettinger
ute. If you want to rant about elitism, bag on volunteer developers, or expound conspiracy theories about insiders and outsiders, then your scottdial.com blog would make a better forum. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://m

Re: [Python-Dev] Tracker rights

2007-03-07 Thread Raymond Hettinger
[Collin Winter]> >Could I be granted rights to the SF tracker? Done. 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/a

[Python-Dev] Fwd: Re: [Python-3000] Removing functions from the operator module

2007-03-07 Thread Raymond Hettinger
d what is already provided by __builtin__.bool and __builtin__.abs. 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

[Python-Dev] Fwd: Re: Encouraging developers

2007-03-07 Thread Raymond Hettinger
sually not too much of a challenge because you're either modifying existing text or are copying in existing markup from the surrounding text. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-d

Re: [Python-Dev] Introduction

2007-03-09 Thread Raymond Hettinger
[Žiga Seilnacht] >I have just accepted an invitation to become a Python >developer, so I feel obliged to introduce myself. Welcome aboard. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pyth

[Python-Dev] Py2.5.1 release schedule

2007-03-21 Thread Raymond Hettinger
What are the current thoughts on when Py2.5.1 will go out? Do we need a bug-day beforehand? Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman

[Python-Dev] Fwd: Re: Py2.5.1 release schedule

2007-03-21 Thread Raymond Hettinger
[Raymond] >> What are the current thoughts on when Py2.5.1 will go out? >> Do we need a bug-day beforehand? [AMK] >A bug day would be a great idea! I have a mailbox bug that'd >greatly benefit from discussion about how to fix the problem. How about Sunda

[Python-Dev] Calling base class methods from C

2007-03-21 Thread Raymond Hettinger
ow you call non-slotted named methods in parent classes? class List(list): def append(self, x): print x List.append(self, x) # What is the C equivalent of this call? Raymond ___ Python-Dev mailing list Python-Dev@python.or

[Python-Dev] Exceptions for readonly attributes

2007-03-23 Thread Raymond Hettinger
. However, changing it makes four of the tests fail. The question for you guys is whether or not to make the fix. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Get 2.5 changes in now, branch will be frozen soon

2007-03-31 Thread Raymond Hettinger
s the de-facto decision and becomes much harder to change. 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] context manager - generator interaction?

2007-04-05 Thread Raymond Hettinger
because it is really more of a suggestion or technique than an actual rule. Also, there are plenty of other situations where the "rule" doesn't apply. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailm

Re: [Python-Dev] [Python-checkins] Python Regression Test Failures opt (1)

2007-04-06 Thread Raymond Hettinger
I believe the failures started with Facundo Batista's checkin on April 4th: - Author: facundo.batista Date: Wed Apr 4 16:10:40 2007 New Revision: 54681 Modified: python/trunk/Lib/test/test_socket_ssl.py Log: Fixed the way that the .pem files are looked for

Re: [Python-Dev] function for counting items in a sequence

2007-04-08 Thread Raymond Hettinger
, 0) + 1 return d 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

[Python-Dev] Changes to decimal.py

2007-04-10 Thread Raymond Hettinger
m usually available on AOL instant messaging with the screename: raymondewt Likewise, consider soliciting Tim's input on how to implement the ln() operation. That one will be tricky to get done efficiently and correctly. Raymond --- Begin Message --- 2007/4/10, Raymond Hettinger <[EMAIL

[Python-Dev] Py2.5.1 release candidate

2007-04-10 Thread Raymond Hettinger
It looks like the release candidate has been held-up for a bit. If it is going to stay held-up for a few days, can we unfreeze it so some bugfixes can go in (fixing the +0/-0 problem, eliminating some segfaults, and fixing some exception code)? Raymond

[Python-Dev] USE_FAST code in stringobject.c

2007-04-10 Thread Raymond Hettinger
Do any of the Iceland sprinters (Fredrik or Andrew perhaps) know why the USE_FAST section is segregated and whether it is supposed to be on or off by default? Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

[Python-Dev] Fwd: Re: Py2.5.1 release candidate

2007-04-10 Thread Raymond Hettinger
> No, the release binaries are all produced, and just await upload. Woohoo! > If it's an urgent issue, we need another RC. > If it isn't urgent (e.g. not a regression relative to 2.5.0), > I think it should wait for 2.5.2. (IMHO all, of course) These bug fixes will h

[Python-Dev] Fwd: Re: Changes to decimal.py

2007-04-10 Thread Raymond Hettinger
needed. > It doesn't matter. We promise to offer a full impleme 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 2.5.1c1 pickle problem

2007-04-11 Thread Raymond Hettinger
The pickle issue may be related to revision 53655 fixing a psuedo-bug (it was arguable whether current or prior behavior was most desirable). Will look at this more and will report back. Raymond ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] Python 2.5.1c1 pickle problem

2007-04-12 Thread Raymond Hettinger
iness. Am leaving this open for others to discuss and decide. The old behavior was surprising to some, but the revised behavior also appears to have some unforeseen consequences. Raymond P.S. In addition to rev 53655, a number of similar changes were ma

Re: [Python-Dev] test_normalization failures across communitybuildbots

2007-04-16 Thread Raymond Hettinger
g up on other machines > since the urlfetch'd files weren't being cleaned out between test > runs. Can you add code to clean them out between runs? Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/

Re: [Python-Dev] PEP 30XZ: Simplified Parsing

2007-05-02 Thread Raymond Hettinger
where cities.city like %s and events.active = 1 and venues.address = addresses.id and addresses.city = cities.id and events.venue = venues.id ''', (city,)) Raymond ___ Python-Dev maili

[Python-Dev] Implicit String Concatenation and Octal Literals Was: PEP 30XZ: Simplified Parsing

2007-05-02 Thread Raymond Hettinger
> Raymond> I find that style hard to maintain. What is the advantage over > Raymond> multi-line strings? > >Raymond> rows = self.executesql(''' >Raymond> select cities.city, state, country >Raymond> from cities, v

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