Re: [Python-3000] Bytes and unicode conversion in C extensions

2008-07-29 Thread Mike Klaas
On 29-Jul-08, at 7:32 AM, Jesus Cea wrote: Working on the 3.0 version of bsddb, I have the following issue. Until 3.0, keys and values were strings. For bsddb, they are opaque, and stored unchanged. In 3.0 the string type is replaced by unicode. A new "byte" type is added. So, code like "d

Re: [Python-3000] suggestion: structured assignment

2008-05-28 Thread Mike Klaas
On 28-May-08, at 6:23 PM, Daniel Wong wrote: Currently, I must do the following instead: for n, pair in enumerate(list_of_pairs): a, b = pair ... <> Thoughts? I find it hard to believe that you have even attempted this, which has been valid in python for ages: >>> for x, (a, b) in enu

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Mike Klaas
On 29-Apr-08, at 2:08 PM, Brett Cannon wrote: On Tue, Apr 29, 2008 at 8:05 AM, Alex Martelli <[EMAIL PROTECTED]> wrote: [SNIP - Alex's well-argued reasons to keep sched] And then, if needed, we can discuss pure simulation (as opposed to simulation-testing of systems designed to normally use

Re: [Python-3000] Spooky behavior of dict.items() and friends

2008-04-02 Thread Mike Klaas
On 2-Apr-08, at 3:48 PM, Martin v. Löwis wrote: >> On Wed, Apr 2, 2008 at 5:08 PM, Mike Klaas <[EMAIL PROTECTED]> >> wrote: >>> ...and the majority of these cases would work fine with views (input >>> to sorted(), etc). >> >> Suppose "the ma

Re: [Python-3000] Spooky behavior of dict.items() and friends

2008-04-02 Thread Mike Klaas
On 2-Apr-08, at 3:33 PM, Jason Orendorff wrote: > On Wed, Apr 2, 2008 at 5:08 PM, Mike Klaas <[EMAIL PROTECTED]> > wrote: >> ...and the majority of these cases would work fine with views (input >> to sorted(), etc). > > Suppose "the majority" here means

Re: [Python-3000] Spooky behavior of dict.items() and friends

2008-04-02 Thread Mike Klaas
On 2-Apr-08, at 2:59 PM, Martin v. Löwis wrote: > Jason Orendorff wrote: >> On Tue, Apr 1, 2008 at 9:37 PM, "Martin v. Löwis" >> <[EMAIL PROTECTED]> wrote: >>> I think it's fairly obvious why the 2.x .keys() has to change. It's >>> just too wasteful to actually build the list of all keys of a >

Re: [Python-3000] Set literal

2008-01-29 Thread Mike Klaas
On 29-Jan-08, at 2:29 PM, Greg Ewing wrote: > Jim Jewett wrote: > >> The majority of uses need a mutable set that starts empty. > > Does anyone have evidence to support that assertion? > > Thinking about my own code, I probably do membership > tests on constant sets (represented as tuples) about

Re: [Python-3000] Need closure on __cmp__ removal

2008-01-18 Thread Mike Klaas
On 18-Jan-08, at 1:37 PM, Lars Immisch wrote: > > I like cmp, too. I've looked through my code, and I've only used it in > script-ish circumstances, but here is an example that sorts a list of > files by modification date: > > def cmp_mtime(f, g): > """Too much for a lambda for my tastes.""" >

Re: [Python-3000] Useless methods in Queue module

2008-01-14 Thread Mike Klaas
On 14-Jan-08, at 5:49 PM, Jeffrey Yasskin wrote: > On Jan 14, 2008 2:55 PM, Mike Klaas <[EMAIL PROTECTED]> wrote: >> This is a misleading name. The number returned from qsize() [not >> size >> ()] is perfectly reliable, in the sense that it is the exact size of >

Re: [Python-3000] Useless methods in Queue module

2008-01-14 Thread Mike Klaas
On 14-Jan-08, at 1:32 PM, Charles Merriam wrote: > Not to be pedantic, but the major concern others are voicing is that > is that queue size is not reliable and is therefore a potential source > of hard to find threading bugs by naive users. Why not just rename > q.size() to the unweildy name of

Re: [Python-3000] Useless methods in Queue module

2008-01-11 Thread Mike Klaas
On 11-Jan-08, at 11:13 AM, Raymond Hettinger wrote: > I proposed to remove three methods from the queue module, qsize(), > empty(), and full(). These are not reliable. The RightWay (tm) is > to trap the Empty and Full exceptions or use the .join() approach. -1. There are several "advisory"

Re: [Python-3000] Need closure on __cmp__ removal

2008-01-09 Thread Mike Klaas
On 9-Jan-08, at 11:41 AM, Oleg Broytmann wrote: > On Wed, Jan 09, 2008 at 11:34:59AM -0800, Brett Cannon wrote: >> On Jan 9, 2008 11:34 AM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: >>>newlist = oldlist.sort(key=lambda v: v.attr_x) >> >> And don't forget about operator.attrgetter(). > >I d

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Mike Klaas
On 25-Sep-07, at 2:01 PM, Mark Summerfield wrote: > On 2007-09-25, Guido wrote: >> >> For that to happen, someone has to write a production-quality >> implementation, release it as a separate 3rd party module for a >> while, >> show that it is sufficiently stable and popular to be incorporated i

Re: [Python-3000] Unicode and OS strings

2007-09-17 Thread Mike Klaas
On 16-Sep-07, at 4:03 PM, Greg Ewing wrote: > Paul Moore wrote: >> On 15/09/2007, Gregory P. Smith <[EMAIL PROTECTED]> wrote: >> >>> similarly for the environment. os.environ dict >>> should be bytes object keys and values >> >> You can't have bytes as keys - the type isn't hashable... > > Has th

Re: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/soc

2007-09-10 Thread Mike Klaas
On 10-Sep-07, at 8:33 AM, Thomas Wouters wrote: > Alternatively, if you know what you're doing, you can edit the > svnmerge-integrated property on the branch directly -- but don't > mess it up :) > svnmerge also has a handy -M flag that marks a (set of) revisions as merged, but doesn't act

Re: [Python-3000] [Python-Dev] Regular expressions, Unicode etc.

2007-08-08 Thread Mike Klaas
On 8-Aug-07, at 2:28 AM, Nick Maclaren wrote: > I have needed to push my stack to teach REs (don't ask), and am > taking a look at the RE code. I may be able to extend it to support > RFE 694374 and (more importantly) atomic groups and possessive > quantifiers. While I regard such things as revo

Re: [Python-3000] Immutable bytes type and dbm modules

2007-08-06 Thread Mike Klaas
On 6-Aug-07, at 7:06 PM, Guido van Rossum wrote: > On 8/6/07, Mike Klaas <[EMAIL PROTECTED]> wrote: >> For instance, it is quite common to use integers as keys. If you are >> inserting keys in order, it is about a hundred times faster to encode >> the ints in big-

[Python-3000] Immutable bytes type and dbm modules

2007-08-06 Thread Mike Klaas
On 6-Aug-07, at 5:39 PM, Guido van Rossum wrote: > > I thought about this issue some more. > > Given that the *dbm types strive for emulating dicts, I think it makes > sense to use strings for the keys, and bytes for the values; this > makes them more plug-compatible with real dicts. (We should id

Re: [Python-3000] Python 3000 Status Update (Long!)

2007-06-22 Thread Mike Klaas
On 22-Jun-07, at 2:44 PM, Jean-Paul Calderone wrote: > On Fri, 22 Jun 2007 14:28:12 -0700, Alex Martelli > <[EMAIL PROTECTED]> wrote: > > Could be. I don't find many of my programs to be bottlenecked on > compilation time or import time, so these optimizations look like > pure lose to me. Nor

Re: [Python-3000] How best to handle failing tests in struni?

2007-06-20 Thread Mike Klaas
On 20-Jun-07, at 10:51 AM, Jean-Paul Calderone wrote: > On Wed, 20 Jun 2007 10:24:55 -0700, Guido van Rossum > <[EMAIL PROTECTED]> wrote: > > > OTOH, pragmatically, people will generally use text strings for > db keys. >> >> I'm not sure how to decide this; perhaps we need to take it public. >

Re: [Python-3000] Python 3000 Status Update (Long!)

2007-06-19 Thread Mike Klaas
On 19-Jun-07, at 12:13 PM, Bill Janssen wrote: >> map (especially the new iterized version) is a frequently-used >> builtin, while reduce is a rarely-used builtin that requires some >> head-wrapping. It makes sense to me to move it out of builtins. > > I've never understood this kind of argument

Re: [Python-3000] Python 3000 Status Update (Long!)

2007-06-19 Thread Mike Klaas
On 19-Jun-07, at 10:51 AM, Bill Janssen wrote: > > Though, from the standpoint of pragmatism, removing "reduce" from the > built-in space will break code (*my* code, among others), and leaving > it in will not affect "purity", as both "map" and "reduce" are being > left in. So leaving it alone se

Re: [Python-3000] Support for PEP 3131

2007-05-25 Thread Mike Klaas
On 25-May-07, at 6:03 AM, Steve Howell wrote: > > We're just disagreeing about whether the Dutch tax law > programmer has to uglify his environment with an alias > of Python to "python3.0 -liberal_unicode," or whether > the American programmer in an enterprisy environment > has to uglify his envi

Re: [Python-3000] PEP 3131 accepted

2007-05-24 Thread Mike Klaas
On 24-May-07, at 3:33 PM, Martin v. Löwis wrote: >> Alas, the coding directive is not good enough. Have a look at this: >> >> http://zesty.ca/python/tricky.png >> >> That's an image of a text editor containing some Python code. Can >> you >> tell whether running it (post-PEP-3131) will del

Re: [Python-3000] pep 3131 again

2007-05-16 Thread Mike Klaas
On 16-May-07, at 6:06 PM, tomer filiba wrote: > > === help people who can't type english === > since the keywords remain ASCII, along with stdlib and all other major > third party libs -- how does that help the english-illiterate > programmer? > > import random > 満は = range(100) > ra

Re: [Python-3000] the future of the GIL

2007-05-09 Thread Mike Klaas
On 5/9/07, Talin <[EMAIL PROTECTED]> wrote: <> > This much I agree: There's no point in talking about supporting multiple > processors using threads as long as we're living in a refcounting world. <> But python isn't--CPython, though, certainly is. The CPython interpreter has enormous stability,

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

2007-05-04 Thread Mike Klaas
On 5/4/07, Baptiste Carvello <[EMAIL PROTECTED]> wrote: > maybe we could have a "dedent" literal that would remove the first newline and > all indentation so that you can just write: > > call_something( d''' > first part > second line > third line

Re: [Python-3000] PEP: Supporting Non-ASCII Identifiers

2007-05-02 Thread Mike Klaas
On 5/1/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Martin v. Löwis wrote: > > > http://mail.python.org/pipermail/python-3000/2006-April/001526.html > > > > where Guido states that he trusts me that it can be made to work, > > and that "eventually" it needs to be supported. +0 > He says "the tools

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Mike Klaas
On 4/23/07, Daniel Stutzbach <[EMAIL PROTECTED]> wrote: > On 4/23/07, Mike Klaas <[EMAIL PROTECTED]> wrote: > > Might it be possible to include variance bars? > > I'm not really sure what variance bars would reveal. Performing > exactly the same operations fol

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Mike Klaas
On 4/23/07, Daniel Stutzbach <[EMAIL PROTECTED]> wrote: > So you can see the performance of the BList in more detail, I've made > several performance graphs available at the following link: >http://stutzbachenterprises.com/blist/ Very cool. These detailed timings are very useful. Might it b

Re: [Python-3000] Empty set and empty dictionary

2007-04-16 Thread Mike Klaas
On 4/16/07, Chris Rebert <[EMAIL PROTECTED]> wrote: > I think someone has probably proposed this before, but why not use "{,}" > as the empty set literal? If you're sure, did you look for it first? http://mail.python.org/pipermail/python-3000/2006-April/001400.html -Mike

Re: [Python-3000] Draft PEP for Requiring Lowercase Literal Modifiers

2007-03-19 Thread Mike Klaas
On 3/19/07, Andrew McCollum <[EMAIL PROTECTED]> wrote: > > Changes like this don't do much for me. Sure, lowercase modifiers are > > prettier, but why remove the general functionality and leave in a few > > special cases, especially when functionality to display numbers in > > those formats exist

Re: [Python-3000] Draft PEP for Requiring Lowercase Literal Modifiers

2007-03-19 Thread Mike Klaas
> Semantic Changes > > > The behavior of the 'int' builtin when passed a radix of 0 will be changed to > follow the above grammar. This change is to maintain the specified behavior > [5]_ that a radix of 0 mirrors the literal syntax. The behavior of this > function will otherwise n

Re: [Python-3000] pre-PEP: Default Argument Expressions

2007-02-13 Thread Mike Klaas
On 2/13/07, Chris Rebert <[EMAIL PROTECTED]> wrote: > This PEP proposes new semantics for default arguments to remove > boilerplate code associated with non-constant default argument values, > allowing them to be expressed more clearly and succinctly. > Specifically, > all defau

Re: [Python-3000] possible new packages (PEP 3108)

2007-01-09 Thread Mike Klaas
On 1/9/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > * 'collections' package > > + heapq > + Queue Putting this in a collections package might exacerbate the confusion over its intended use. It really is more of a threading synchronization tool than a general queue datastructure (though it

Re: [Python-3000] PEP 3108: Standard Library Reorganization

2007-01-02 Thread Mike Klaas
On 1/2/07, Anthony Baxter <[EMAIL PROTECTED]> wrote: > Additionally, base32 and base16 are not supported by codecs, > according to the docs, and neither is the ability to specify > alternate character mappings (I don't know how heavily used the > last is, though). We use the "urlsafe" version hea

Re: [Python-3000] PEP 3108: Standard Library Reorganization

2007-01-01 Thread Mike Klaas
On 1/1/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > * new > + Just a rebinding of names from the 'types' module. > + Can also call ``type`` built-in to get most types easily. Perhaps 'types' should be deprecated instead? obj.x = new.instancemethod(... has a very pleasing ring to it (per

Re: [Python-3000] how about switching to a preprocessor? (Re: A better way to initialize PyTypeObject)

2006-12-04 Thread Mike Klaas
On 12/2/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Mike Klaas wrote: > > > Reducing the pyrex magic and adding more detailed errors to the code > > generator should eliminate much of the "code-peering" that is > > currently necessary (at least, by me) whe

Re: [Python-3000] how about switching to a preprocessor? (Re: A better way to initialize PyTypeObject)

2006-12-02 Thread Mike Klaas
On 12/2/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > Regardless, one could take a Pyrex bent on this and having Python-like > > method declarations but have C as the code body:: > > (some days, I wonder if we shouldn't just include Pyrex and tell every- > one to use that for *all* their extens

Re: [Python-3000] Builtin iterator type

2006-11-16 Thread Mike Klaas
On 11/16/06, George Sakkis <[EMAIL PROTECTED]> wrote: > > I agree. For me, the bottom line and the main argument for dropping > the proposal is "itertools is not as big as you think it is to > introduce a builtin rich-iterator object". <> You should also consider that some people see that as a fal

Re: [Python-3000] Builtin iterator type

2006-11-14 Thread Mike Klaas
On 11/14/06, George Sakkis <[EMAIL PROTECTED]> wrote: > On 11/14/06, Mike Klaas <[EMAIL PROTECTED]> wrote: > > I don't see the problem of importing important language functionality. > > Most languages since c have required somthing similar. > > Most lan

Re: [Python-3000] Builtin iterator type

2006-11-14 Thread Mike Klaas
On 11/14/06, George Sakkis <[EMAIL PROTECTED]> wrote: > And for those objecting to touching the existing iter() or bloating > the builtin namespace with yet another builtin, let me mention that we > can get rid of *two* existing functions which for some reason were > promoted to builtin status, al

Re: [Python-3000] packages in the stdlib

2006-06-01 Thread Mike Klaas
Terry Reedy wrote: > Because you have to type it over and over. hmm, With the right context manager: import py with py as py: from gui import tkinker import net with net as net: import httplib import urllib -Mike ___ Python

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Mike Klaas
On 5/2/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Looks like we're converging on consensus about this issue. Perhaps > someone can attempt an implementation in the p3yk (sic) branch? I'll > add a line to PEP 3100; I don't see that a whole new PEP is necessary > to summarize the discussion he

Re: [Python-3000] sets in P3K?

2006-04-28 Thread Mike Klaas
On 4/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > You did notice the ;-) in my post on that topic, right? That was meant to > imply it wasn't a serious proposal. Sure did . I'd be shocked if non-ascii punctuation was ever seriously considered. But ascii phi-like things have been propo

Re: [Python-3000] sets in P3K?

2006-04-28 Thread Mike Klaas
On 4/27/06, Gareth McCaughan <[EMAIL PROTECTED]> wrote: > On Thursday 2006-04-27 11:42, Georg Brandl wrote: > > Kay Schluehr wrote: > ... > > > Furthermore: what about notions of infinite sets? > > > > Can you elaborate on that? > > Seems to me that if you want infinite sets, you want some type > o