Re: [Python-3000] Iterators for dict keys, values, and items == annoying :)

2006-03-25 Thread Georg Brandl
Adam DePrince wrote: >> Maybe. I need a volunteer to write the PEP! > > PEP: XXX > Title: Mutable Iterations Comments (mostly grammar) inline. > This PEP proposes an extension to the iteration protocol to > support deletion. Invocation of the delete method would result in

Re: [Python-3000] Parallel iteration syntax

2006-03-28 Thread Georg Brandl
Guido van Rossum wrote: >> Slightly too late for consideration, I did come up with >> what I believe is a backwards-compatible syntax extension >> to support this: >> >>for (x in iter1, y in iter2): >> ... [...] > Based on the feedback so far I think not. There's also the issue that > >

Re: [Python-3000] pre-PEP: Procedure for PEPs with Backwards-Incompatible Changes

2006-03-28 Thread Georg Brandl
Guido van Rossum wrote: > On 3/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> >> Suggestion: Make this PEP 3001 and start any Py3k PEPs from 3100 >> >> Guido> I already proposed that numbering scheme. More formally, Py3k >> Guido> meta PEPs go between 3001 and 3099, and f

Re: [Python-3000] String formating operations in python 3k

2006-04-02 Thread Georg Brandl
Crutcher Dunnavant wrote: > Python currently supports 'S % X', where S is a strinng, and X is one of: > * a sequence > * a map > * treated as (X,) > > But I have some questions about this for python 3000. > > 1. Shouldn't there be a format method, like S.format(), or S.fmt()? Possible, but why?

[Python-3000] pre-PEP: Things that Will Not Change in Python 3.0

2006-04-02 Thread Georg Brandl
Guido van Rossum wrote: > On 4/2/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> A quick idea of mine: Wouldn't it be useful to maintain a list of what will >> not change, collected in the discussions here? That way, people eager to >> suggest >> br

Re: [Python-3000] Iterating over a dict

2006-04-03 Thread Georg Brandl
Guido van Rossum wrote: > On 4/1/06, Thomas Lotze <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I wonder what's the reason for iterating over a dict by keys: >> >> >>> for x in {1:"a", 2:"b"}: >> ... print x >> ... >> 1 >> 2 >> >> I find it much more intuitive for the values, "a" and "b", to be acces

[Python-3000] pre-PEP: Process for reviewing/improving stdlib modules in 3.0

2006-04-03 Thread Georg Brandl
PEP: XXX Title: Procedure for changing standard library modules Version: $Revision$ Last-Modified: $Date$ Author: Georg Brandl <[EMAIL PROTECTED]> Status: Draft Type: Informational Content-Type: text/x-rst Created: 02-Apr-2006 Abstract This PEP describes the procedure for reviewi

Re: [Python-3000] String formating operations in python 3k

2006-04-03 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > I sort of lost track of the thread, then noticed a recent message where > Guido seems to be cozying up to the idea, so I thought maybe I ought to > think about it for a few minutes. As far as I can tell, the proposal is: > > usage example > s.forma

Re: [Python-3000] pre-PEP: Things that Will Not Change in Python 3.0

2006-04-04 Thread Georg Brandl
Guido van Rossum wrote: > I was going to comment about this one "check it in, we'll add to it > later", but then I realized it's not 100% clear whether this is a > feature PEP or a meta-PEP? It focuses on features so by that yardstick > it's a feature PEP. But in its list-of-miscellany nature it >

Re: [Python-3000] pre-PEP: Process for reviewing/improving stdlibmodules in 3.0

2006-04-04 Thread Georg Brandl
Terry Reedy wrote: > "Guido van Rossum" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>I didn't see any comments on this PEP. > > For me, it is pretty clear and sensible, hence not much to say. > Plus I expected others to says whatever was needed ;-). > >> I'm not sure that the

Re: [Python-3000] String formating operations in python 3k

2006-04-04 Thread Georg Brandl
Greg Ewing wrote: > Barry Warsaw wrote: > >> I don't much like the $"" prefix > > This was discussed during the last round of formatting > wars, and the conclusion was that having $ both > inside and outside the string would be too visually > confusing. Another issue is that current string prefi

Re: [Python-3000] pre-PEP: Things that Will Not Change in Python 3.0

2006-04-05 Thread Georg Brandl
Guido van Rossum wrote: > On 4/4/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> > I was going to comment about this one "check it in, we'll add to it >> > later", but then I realized it's not 100% clear whether th

Re: [Python-3000] Will we have a true restricted exec environment for python-3000?

2006-04-09 Thread Georg Brandl
Greg Ewing wrote: > Nick Coghlan wrote: > >> If yes, then you can get to object(), and hence to pretty much whatever C >> builtins you want. > > Perhaps instead of attributes like __class__ and __subtypes__ > there should be functions like classof() and subtypes() that > could be excluded from a

Re: [Python-3000] symbols?

2006-04-10 Thread Georg Brandl
Kendall Clark wrote: > PS--I'd also like "?", "!", and "-" to be legal characters in > function, method, and variable names, but I won't push my luck -- and > I seem to remember Guido saying that would never happen, at some > point back in the day. Fair enough. ;> At least "-" can never be

Re: [Python-3000] Adaptation and type declarations

2006-04-10 Thread Georg Brandl
Chaz. wrote: > If you are going this far, why not also support a throws() modifier (or > whatever you might call it). > > Right now I do something like: > > @throws(IOError) > def foo(...) : > > as a way to indicate that foo() can throw a specific exception. > > I might suggest > > def foo(..

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Georg Brandl
Kay Schluehr wrote: > Talin schrieb: > >>A set with no elements is: >> >> set() >> >>Alternatively, you could take the tuple idea one step further: >> >> {,} >> >> > If you want to simulate the mathematical notion of an empty set I would > say that {/} has a stronger mnemonic appeal. It al

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Georg Brandl
Nick Coghlan wrote: > Georg just added the idea of automatically invoking str() in str.join() to > PEP > 3100 with a question mark on the end. I thought I'd responded when Talin > first > brought it up, but couldn't find a record of that in the archive (this is why > one suggestion per message

Re: [Python-3000] Stackable Blocks

2006-04-27 Thread Georg Brandl
Crutcher Dunnavant wrote: > Having been shot down so hard on my request to bring for loops into > symetry with list comprehensions, I have a new proposal - stackable > blocks. > > This is a very _small_ amount of syntax sugar, the basic idea is that > any block headers can be stacked on the same l

Re: [Python-3000] Unicode identifiers (Was: sets in P3K?)

2006-04-29 Thread Georg Brandl
Martin v. Löwis wrote: > Guido van Rossum wrote: >>> I was hoping to propose a PEP on non-ASCII identifiers some >>> day; that would (of course) include a requirement that the >>> standard library would always be restricted to ASCII-only >>> identifiers as a style-guide. >> >> IMO communication ab

Re: [Python-3000] Add a standard GUI system

2006-04-29 Thread Georg Brandl
Oleg Broytmann wrote: > On Sat, Apr 29, 2006 at 09:28:44AM +0200, Kay Schluehr wrote: >> No one uses GTK+ on Windows. > >GAIM. And Gimp, yes, but these only use it because they were originally not made with a Windows port in mind. Georg ___ Python

Re: [Python-3000] sets in P3K?

2006-04-30 Thread Georg Brandl
Greg Wilson wrote: >> Ron Adam: >> How about the '!' which is currently used indicate a python long and an >> integer. Here it would indicate the difference between a frozen >> container and a mutable container. >> frozen_set = {1, 2, 3}! >> frozen_dict = {1:'a', 2:'b', 3:'c'}! > > Greg

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Georg Brandl
Raymond Hettinger wrote: >>That doesn't fix everybody's brain though. Given that sets are much >>less universally useful than dicts I don't think that dict should >>"give in". >> >> >> >> > Right. Changes to the {} notation for empty dicts should be off the > table lest we have a lifetime of reg

Re: [Python-3000] PEP 3100 Comments

2006-05-07 Thread Georg Brandl
Greg Ewing wrote: > Talin wrote: > >> (Admittedly this particular case could be done without 'callable', since you >> could test for string type, and assume callable otherwise. > > Yes, and that's exactly why it can be made to work > in this particular case. Most likely no testing for > callabili

Re: [Python-3000] PEP 3100 Comments

2006-05-08 Thread Georg Brandl
Guido van Rossum wrote: > Well, personally, I don't see the advantage. I don't see the point of > having lots of different exception types that say "you made a > programming error" in different ways, and I severely doubt the > usefulness of being able to distinguish between those different > failur

Re: [Python-3000] Use case for generics

2006-05-14 Thread Georg Brandl
Greg Ewing wrote: > Talin wrote: > >> r = Rectangle( x, y, w, h ) >> r = Rectangle( minpos, maxpos ) >> r = Rectangle( position, size ) > > This sort of thing is better done in Python using > keyword arguments: > >Rectangle(left = x, top = y, width = w, height = h) >Rectan

Re: [Python-3000] Math in Python 3.0

2006-05-14 Thread Georg Brandl
Martin v. Löwis wrote: > Giovanni Bajo wrote: @overloaded def sqrt(value): raise TypeError("Cannot take square root of %s" % type(value).__name__) @sqrt.overload def sqrt_float(value : float): return math.sqrt(value) >>> So where would that sqrt

Re: [Python-3000] State of the object system

2006-05-17 Thread Georg Brandl
Michael Chermside wrote: >> ( BTW this signals the user that the object system is quite immature >> and early alpha. Maybe one should >> rethink commenting the current state of development all over the >> public docs? ) > > You are completely correct. The manual is misleading and makes the st

Re: [Python-3000] [Python-Dev] xrange vs. int.__getslice__

2006-07-04 Thread Georg Brandl
Guido van Rossum wrote: > Please don't cross-post python-dev and python-3000. > > This proposal will not be adopted in Py3k. Instead, range() will > become more like xrange(). Added to PEP 3099. Georg ___ Python-3000 mailing list Python-3000@python.or

Re: [Python-3000] Switch and static, redux

2006-07-05 Thread Georg Brandl
Andrew Clover wrote: > Guido van Rossum <[EMAIL PROTECTED]> wrote: > >> (I'm not super confident about the syntax alternatives yet.) > > The switch:-without-indent business still naggingly makes me feel > uncomfortable. > > Is this a valid no-case-switch? > >switch cake: >print 'hello'

Re: [Python-3000] Switch and static, redux

2006-07-07 Thread Georg Brandl
Ka-Ping Yee wrote: > On Wed, 5 Jul 2006, Guido van Rossum wrote: >> So, my proposal is to give up on static, accept PEP 3103 with the >> following options: >> - Syntax alternative 2+B (unindented cases, 'case in ...' for >> multiple cases). >> - Semantics option 3 (def-time freezing) >> >>

Re: [Python-3000] No Container Literals

2006-07-08 Thread Georg Brandl
Calvin Spealman wrote: > Just throwing this out there, but I would love to see a complete > dropping of container literals from Python. That is why I proposed the > coercion syntax (ex: list from something) because it would allow > things like list(1, 2, 3) and we can already do dict(ten=10, > elev

Re: [Python-3000] No Container Literals

2006-07-08 Thread Georg Brandl
Calvin Spealman wrote: > On 7/8/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> Calvin Spealman wrote: >> > Just throwing this out there, but I would love to see a complete >> > dropping of container literals from Python. That is why I proposed the >> >

Re: [Python-3000] callable()

2006-07-27 Thread Georg Brandl
Greg Ewing wrote: > Guido van Rossum wrote: > >> I'd be happy to extend the convention to all such attributes -- >> setting it to None to mean that the subclass doesn't want to provide >> it. That's clean, can't possibly be interpreted to mean anything else, >> and doesn't require you to actually

Re: [Python-3000] Python/C++ question

2006-08-13 Thread Georg Brandl
Talin wrote: > Guido van Rossum wrote: >> On 8/9/06, Talin <[EMAIL PROTECTED]> wrote: >> For the majority of Python developers it's probably the other way >> around. It's been 15 years since I wrote C++, and unlike C, that >> language has changed a lot since then... >> >> It would be a complete re

Re: [Python-3000] threading, part 2

2006-08-14 Thread Georg Brandl
Guido van Rossum wrote: > On 8/11/06, tomer filiba <[EMAIL PROTECTED]> wrote: >> i mailed this to several people separately, but then i thought it could >> benefit the entire group: >> >> http://sebulba.wikispaces.com/recipe+thread2 >> >> it's an implementation of the proposed " thread.raise_exc",

Re: [Python-3000] Python/C++ question

2006-08-14 Thread Georg Brandl
Guido van Rossum wrote: > On 8/13/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> Talin wrote: >> > Guido van Rossum wrote: >> >> On 8/9/06, Talin <[EMAIL PROTECTED]> wrote: >> >> For the majority of Python developers it's probably the

[Python-3000] raise with traceback?

2006-08-20 Thread Georg Brandl
Hi, as raise ValueError, "something went wrong" is going to go away, how will one raise with a custom traceback? The obvious raise ValueError("something went wrong"), traceback or something more esoteric like raise ValueError("something went wrong") with traceback ? Georg

Re: [Python-3000] raise with traceback?

2006-08-20 Thread Georg Brandl
Terry Reedy wrote: > "Guido van Rossum" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> I wonder if "raise ValueError" should still be allowed (as equivalent >> to "raise ValueError()") or that it should be disallowed. > > +1 for disallow. > > raise is a simple rule to remember.

Re: [Python-3000] [PythonInfo Wiki] Update of "GoogleSprintPy3k" by 65.57.245.11

2006-08-21 Thread Georg Brandl
python.org Webmaster wrote: > Dear Wiki user, > > You have subscribed to a wiki page or wiki category on "PythonInfo Wiki" for > change notification. > > The following page has been changed by 65.57.245.11: > http://wiki.python.org/moin/GoogleSprintPy3k > > -

Re: [Python-3000] Droping find/rfind?

2006-08-22 Thread Georg Brandl
Tim Peters wrote: > [Guido van Rossum] >> At today's sprint, one of the volunteers completed a patch to rip out >> find() and rfind(), replacing all calls with index()/rindex(). But now >> I'm getting cold feet -- is this really a good idea? (It's been listed >> in PEP 3100 for a long time, but I h

Re: [Python-3000] Droping find/rfind?

2006-08-23 Thread Georg Brandl
Steven Bethard wrote: > Steven Bethard wrote: >> Could you post a simple example or two? > > Josiah Carlson wrote: >> index = text.find(...) >> if index >= 0: >> ... >> > [snip] >> index = 0 >> while 1: >> index = text.find(..., index) >> if index == -1: >>

Re: [Python-3000] Droping find/rfind?

2006-08-23 Thread Georg Brandl
Paul Prescod wrote: > Just throwing it out but what about something like: > > found, index = text.index("abc") > > if found: >doSomething(index) -1. str.index()'s semantics should not be different from list.index(). Georg ___ Python-3000 mailing

Re: [Python-3000] find -> index patch

2006-08-23 Thread Georg Brandl
Josiah Carlson wrote: > "Guido van Rossum" <[EMAIL PROTECTED]> wrote: >> Here's the patch (by Hasan Diwan, BTW) for people's perusal. It just >> gets rid of all *uses* of find/rfind from Lib; it doesn't actually >> modify stringobject.c or unicodeobject.c. It doesn't use >> [r]partition()'; someone

[Python-3000] Set literals

2006-08-28 Thread Georg Brandl
At python.org/sf/1547796, there is a preliminary patch for Py3k set literals as specified in PEP 3100. Set comprehensions are not implemented. have fun, Georg ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/p

Re: [Python-3000] Set literals

2006-08-28 Thread Georg Brandl
Guido van Rossum wrote: > On 8/28/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> At python.org/sf/1547796, there is a preliminary patch for Py3k set literals >> as specified in PEP 3100. > > Very cool! This is now checked in. Wow, that's fast... > Georg, can

Re: [Python-3000] Set literals

2006-08-28 Thread Georg Brandl
Guido van Rossum wrote: >> > Georg, can you do something about repr() of an empty set? This >> > currently produces "{}" while it should produce "set()". >> >> Right, forgot about that case. I'll correct that now. >> (Grr, I even mindlessly changed the unittest that would have caught it) > > Chec

Re: [Python-3000] Set literals

2006-08-28 Thread Georg Brandl
Guido van Rossum wrote: >> > However you might be able to just cleanup the grammar so they are >> > identical, that would be simpler I suspect. >> >> Looking at the grammar, there's only testlist_safe left to kill, in >> favor of or_test like in generator expressions. The old_ rules are still >> n

Re: [Python-3000] Set literals

2006-08-28 Thread Georg Brandl
Raymond Hettinger wrote: > Georg Brandl wrote: > >>In the meantime, I played around with the peepholer and tried to copy >>the "for x in tuple_or_list" optimization for sets. Results are in SF >>patch #1548082. >> > Did you mean "if x in tu

Re: [Python-3000] Set literals

2006-08-29 Thread Georg Brandl
Guido van Rossum wrote: > On 8/28/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> At python.org/sf/1547796, there is a preliminary patch for Py3k set literals >> as specified in PEP 3100. > > Very cool! This is now checked in. > > Georg, can you do something a

Re: [Python-3000] have zip() raise exception for sequences of different lengths

2006-08-31 Thread Georg Brandl
Raymond Hettinger wrote: >>How about a keyword-only argument called finish which is a callable to >>deal with the problem? When any sequence is exhausted, its position >>is filled with StopIteration, and then finish(result) is returned. >> >> >> > > How about we resist the urge to complicate th

[Python-3000] Ripping out exec

2006-09-01 Thread Georg Brandl
Hi, in process of ripping out the exec statement, I stumbled over the following function in symtable.c (line 468ff): /* Check for illegal statements in unoptimized namespaces */ static int check_unoptimized(const

Re: [Python-3000] Ripping out exec

2006-09-01 Thread Georg Brandl
Guido van Rossum wrote: > I would just rip it out. It turns out that it's not so easy. The exec statement currently can modify the locals, which means that def f(): exec "a=1" print a succeeds. To make that possible, the compiler flags scopes containing exec statements as unoptimized a

Re: [Python-3000] Ripping out exec

2006-09-01 Thread Georg Brandl
Guido van Rossum wrote: > On 9/1/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> > I would just rip it out. >> >> It turns out that it's not so easy. The exec statement currently can >> modify the locals, which means that &g

[Python-3000] The future of exceptions

2006-09-02 Thread Georg Brandl
While looking at the changes necessary to implement the exception related syntax changes (except ... as ..., raise without type), I came across some more substantial things that I think must be discussed. * How should exceptions be represented in C code? Should there still be a (type, value, tra

Re: [Python-3000] have zip() raise exception for sequences of different lengths

2006-09-05 Thread Georg Brandl
Giovanni Bajo wrote: > Raymond Hettinger wrote: > >> It's a PITA because it precludes all of the use cases whether the >> inputs ARE intentionally of different length (like when one argument >> supplys an infinite iterator): >> >>for lineno, ts, line in zip(count(1), timestamp(), sys.stdin): >

Re: [Python-3000] BOM handling

2006-09-13 Thread Georg Brandl
Antoine Pitrou wrote: > Le mercredi 13 septembre 2006 à 09:41 -0700, Josiah Carlson a écrit : >> And is generally ignored, as per unicode spec; it's a "zero width >> non-breaking space" - an invisible character with no effect on wrapping >> or otherwise. > > Well it would be better if Py3K (with a

Re: [Python-3000] Sky pie: a "var" keyword

2006-10-09 Thread Georg Brandl
Fredrik Lundh wrote: > Neil Toronto wrote: > >> A "var" keyword fixes them all. The "global" gotcha: >> >> x = 0 >> def f(): >>print x # no exception - prints "0" >>x = 3 >> >> def g(): >>print x # exception >>var x = 3 > > what are the exact semantics of "var" ? are you sayi

Re: [Python-3000] ugly pie: a "var" keyword

2006-10-09 Thread Georg Brandl
Antoine Pitrou wrote: > Le lundi 09 octobre 2006 à 12:49 +0200, Georg Brandl a écrit : >> They wouldn't be "local" unless declared with "var", I assume. > > Which is a sure way to cause all kind of frigging bugs if you forget to > put "var"

Re: [Python-3000] Sky pie: a "var" keyword

2006-10-11 Thread Georg Brandl
Nick Coghlan wrote: > P.S. In case it wasn't clear, I'm personally fine with 'nonlocal'. The only > objections I've seen to the term are that it's a negative definition (but the > concept itself is a negative one) and the word looks ugly to some folks. > Neither of those objections bothers me o

Re: [Python-3000] try ... then ... then ... except / finally

2006-10-12 Thread Georg Brandl
Antoine wrote: > try: > self.db_transaction.commit() > then: > self.tmpoutfile.close() > then: > self.destroy_shared_memory_handle() > except Exception, e: > logging.error("an exception occurred in cleanup: %s", e) Can you explain the difference to: try: self.db_transaction

Re: [Python-3000] try ... then ... then ... except / finally

2006-10-12 Thread Georg Brandl
Antoine wrote: >> Can you explain the difference to: >> >> try: >> self.db_transaction.commit() >> self.tmpoutfile.close() >> self.destroy_shared_memory_handle() >> except Exception, e: >> logging.error("an exception occurred in cleanup: %s", e) > > In your construct, if self.d

Re: [Python-3000] Proposal: No more standard library additions

2006-10-15 Thread Georg Brandl
Greg Ewing wrote: > Ivan Krstić wrote: > >> That'd be nice. And on that note, for the love of confused masses >> everywhere, can we please change the name of easy_install to something >> Python-specific, such as 'egg' or 'py_install'? > > I don't think that easy_install support is going to > beco

Re: [Python-3000] Draft PEP for outer scopes

2006-11-02 Thread Georg Brandl
Jan Grant wrote: > On Wed, 1 Nov 2006, Steven Bethard wrote: > >> I don't think that'll really be worth it. I'd be amazed if people >> didn't expect it to mean "top-level". The real question is, if people >> see something like this:: >> >> def f(): >> n = 0 >> def g(i): >>

Re: [Python-3000] Path Reform: Get the ball rolling

2006-11-02 Thread Georg Brandl
Mike Orr wrote: > The thread on python-dev has been revived, so those interested in this > subject will want to look in both places. > > On 11/1/06, Talin <[EMAIL PROTECTED]> wrote: >> Actually I generally use: >> >>p = os.path.normpath( os.path.join( __file__, "../..", "lib" ) ) >> >> or

Re: [Python-3000] The meaning of "global variable"

2006-11-05 Thread Georg Brandl
Ron Adam wrote: > I presume you meant: > > def f(): > x = 42 > def g(): > def h(): > parent x > x = 88 > > > The x would be a new local x in function g and have no effect on the x in > function f. Parent would do exactly what it means in this case,

Re: [Python-3000] The meaning of "global variable"

2006-11-05 Thread Georg Brandl
Marcin 'Qrczak' Kowalczyk wrote: > Ron Adam <[EMAIL PROTECTED]> writes: > >> By not limiting parent to just the parent scope you create exceptions. The >> rule >> becomes: >> >> The keyword (*)nonlocal designates a name will be written to in the >> closest enclosing "parent" scope *ex

Re: [Python-3000] print() parameters in py3k

2006-11-19 Thread Georg Brandl
Guido van Rossum wrote: > On 11/19/06, James Thiele <[EMAIL PROTECTED]> wrote: >> The BDFL has said that print will change from a statement to a function in >> Python 3. >> >> I haven't found anything describing what parameters it will take and what it >> will return. Has this been decided? > > No

Re: [Python-3000] print() parameters in py3k

2006-11-19 Thread Georg Brandl
Guido van Rossum wrote: > PEPs aren't only for difficult discussions. :-) They are also there > for reference and to record agreement. Referring to an email isn't > really a very good answer when someone asks (as happened here) "what > is the spec"? A PEP may also discourage attempts to add more

Re: [Python-3000] __nonzero__ vs. __bool__

2006-11-22 Thread Georg Brandl
Terry Reedy schrieb: > "Brett Cannon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Why can't the fallback usage just pass the return value from __len__ to > bool() (forget the C function name) and return that result? It's just like > doing:: > > def bool(obj): > t

Re: [Python-3000] Py3k release schedule worries

2006-12-19 Thread Georg Brandl
Guido van Rossum schrieb: [snip... full ACK] > For example, there are some PEPs that I'd like to see written where > the basic goal has been firmly established but the details need > working out: > > - a collection of ABCs to be used with the standard types; see Bill > Janssen's wiki page > - op

Re: [Python-3000] Py3k release schedule worries

2006-12-19 Thread Georg Brandl
Guido van Rossum schrieb: > On 12/19/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> Georg Brandl wrote: >> >> > so what about id() and intern(). Care to pronounce? >> >> moving/removing id()? please don't do that; id(obj) and type(obj) are >&g

Re: [Python-3000] Py3k release schedule worries

2006-12-19 Thread Georg Brandl
Barry Warsaw schrieb: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Dec 19, 2006, at 1:03 PM, Guido van Rossum wrote: > >> On 12/19/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>> Georg Brandl wrote: >>> >>>> so what about id()

Re: [Python-3000] Py3k release schedule worries

2006-12-19 Thread Georg Brandl
Guido van Rossum schrieb: > On 12/19/06, Talin <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> > Um, that was tongue-in-cheek. My serious proposal was python-4000, but >> > python-ideas sounds better to me because it won't eventually outdate >> > itself. >> >> python-future. (python-ideas

Re: [Python-3000] Py3k release schedule worries

2006-12-20 Thread Georg Brandl
Guido van Rossum schrieb: > On 12/19/06, Georg Brandl <[EMAIL PROTECTED]> wrote: >> > - turning list comprehensions into syntactic sugar for generator >> > expressions >> >> I'd like to point out that there is already my patch for that, which

Re: [Python-3000] The grand renaming

2007-12-30 Thread Georg Brandl
Christian Heimes schrieb: > Python 3.0a2 is out and some people are working on backports of Python > 3.0 features to 2.6. Shouldn't we start to rename the new API functions > and files to their final names before we back merge code to 2.6? > > I'm proposing to change the names and files as followi

Re: [Python-3000] Default factory that uses key

2008-01-06 Thread Georg Brandl
hashcollision schrieb: > The default factory that collections.defaultdict takes cannot use key. > Is there a way to have the default factory take the key into > consideration? For example > > d = collections.defaultdict(lambda title: BookShelf(title)) > > If not, I propose that it be added.

Re: [Python-3000] Request for prod()

2008-01-06 Thread Georg Brandl
hashcollision schrieb: > I request the addition of prod(): > > def prod(seq): > s = 1 > for x in seq: > s *= x > > prod is always as useful as sum() It would have to be called product(), and I believe it has been proposed multiple times and been rejected under the "not every

Re: [Python-3000] Request for prod()

2008-01-06 Thread Georg Brandl
Paul Moore schrieb: > On 06/01/2008, Georg Brandl <[EMAIL PROTECTED]> wrote: >> hashcollision schrieb: >> > I request the addition of prod(): >> It would have to be called product(), and I believe it has been proposed >> multiple times and been rejected under t

Re: [Python-3000] Request for prod()

2008-01-06 Thread Georg Brandl
Paul Moore schrieb: > On 06/01/2008, Georg Brandl <[EMAIL PROTECTED]> wrote: >> Paul Moore schrieb: >> > On 06/01/2008, Georg Brandl <[EMAIL PROTECTED]> wrote: >> >> hashcollision schrieb: >> >> > I request the addition of prod(): >>

Re: [Python-3000] parser/compiler interface [was Re: compiler module]

2008-01-11 Thread Georg Brandl
Martin v. Löwis schrieb: >> * you can parse things with parser.suite(), but not create an AST from >>the parse result >> * you can create an AST with an undocumented flag to compile(), but not >>compile the resulting AST > > The flag is documented, in the document referred to. > > There a

[Python-3000] parser/compiler interface [was Re: compiler module]

2008-01-11 Thread Georg Brandl
Brett Cannon schrieb: > On Jan 10, 2008 2:08 PM, Joe Angell <[EMAIL PROTECTED]> wrote: >> Oh I see... forgive my ignorance but could you point me at some >> documentation or a project that uses the c AST as you mentioned? Is >> that done through some part of the C-API? I cannot find that in the >

Re: [Python-3000] Failure building docs of py3k r30a2

2008-01-13 Thread Georg Brandl
Eric Hanchrow schrieb: > On Ubuntu 7.10 "Gutsy Gibbon": > > Unfortunately I don't really know python, so am unable to debug this. > > I checked out by doing > > svn co http://svn.python.org/projects/python/tags/r30a2 py3k > > Then I built python itself with no apparent trouble. But bui

Re: [Python-3000] Set literal

2008-01-26 Thread Georg Brandl
Guido van Rossum schrieb: > On Jan 26, 2008 1:45 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> Am strongly -1 on changing the repr for set to set({a, b, c}) . Creating >> an innermost frozenset doubles the memory consumption. > > Raymond, I think you're overestimating how often the repr()

Re: [Python-3000] [Python-ideas] Namespaces are one honking great idea -- let's do more of those!

2008-02-02 Thread Georg Brandl
Guido van Rossum schrieb: > This should be brought up on the python-3000 list; I'm moving it there > using a Bcc to python-ideas. > > To some extent it is up to the vendors who distribute binaries -- they > decide what to call it. > > Perhaps we should only install "python3.0" and not "python". T

Re: [Python-3000] [Python-ideas] Namespaces are one honking great idea -- let's do more of those!

2008-02-02 Thread Georg Brandl
Christian Heimes schrieb: > Georg Brandl wrote: >> I would prefer a "python3" alias analogous to the current "python" alias, >> at least as long as Python 2.x is still in wide use. >> >> Having to type "python3.0" explicitly strikes me a

Re: [Python-3000] Set literal

2008-02-02 Thread Georg Brandl
Greg Ewing schrieb: > Stephen J. Turnbull wrote: >> Greg Ewing writes: >> >> > Also, if generator expressions had come first, we >> > would probably never have gotten list comprehensions. >> >> I don't understand. A list comprehension is for when you know you're >> going to want to work with t

Re: [Python-3000] PEP 3102

2008-02-15 Thread Georg Brandl
Dj Gilcrease schrieb: > On Fri, Feb 15, 2008 at 8:46 AM, Joel Bender <[EMAIL PROTECTED]> wrote: >> How about a BNFish notation? Use brackets around optional parameters. >> >> def test([arg1, [arg2,]] arg3): >> ... > > If I understand right, positional only arguments would not be op

Re: [Python-3000] Using *a for packing in lists and other places

2008-03-15 Thread Georg Brandl
Guido van Rossum schrieb: > Thomas Wouters suggests some new syntax: > > http://bugs.python.org/issue2292 > a, b, *c = range(5) > *a, b, c = a, b, *c a, b, c > ([0, 1, 2], 3, 4) [ *a, b, c ] > [0, 1, 2, 3, 4] L = [ a, (3, 4), {5}, {6: None}, (i for i in range(7, 10)) ] >

Re: [Python-3000] Using *a for packing in lists and other places

2008-03-16 Thread Georg Brandl
Neil Toronto schrieb: > Besides, as the SmugLispWeenies have noted, Python is becoming more like > Lisp all the time: > > (setq obj '(an ex-parrot)) ; (AN EX-PARROT) > `(I have ,obj) ; (I HAVE (AN EX-PARROT)) > `(I have ,@obj) ; (I HAVE AN EX-PARROT) Onl

[Python-3000] getargs.c

2008-03-16 Thread Georg Brandl
(See also Issue 2298) String/Unicode/Bytes handling in getargs.c is in dire need of some love; also the docs need to be made consistent with the implementation w.r.t. where a string/unicode is needed, whether null bytes are allowed, etc. Perhaps something for the PyCon sprint? Georg -- Thus sp

Re: [Python-3000] Making 2to3 installable

2008-03-16 Thread Georg Brandl
Martin v. Löwis schrieb: > After talking to Collin, I just committed a change to > 2to3 to make it installable as an executable script > called "2to3". > > To do so, I had to wrap all the top-level modules > into a package, and move the fixes and tests into > that package. Lacking a better name, I

Re: [Python-3000] u'text' as an alias for 'text'?

2008-03-21 Thread Georg Brandl
Amaury Forgeot d'Arc schrieb: > Ralf Schmitt wrote: >> >> On Thu, Mar 20, 2008 at 1:30 PM, Lennart Regebro <[EMAIL PROTECTED]> wrote: >> > >> > On Thu, Mar 20, 2008 at 1:16 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> >> wrote: >> > > However, it *is* common to install Python code before running it.

Re: [Python-3000] u'text' as an alias for 'text'?

2008-03-21 Thread Georg Brandl
Martin v. Löwis schrieb: >>> It was proposed before, I don't know whether any implementation >>> on that has started. >> >> I don't see anything in the bug tracker. I'd be willing to look at it, >> if this is what we want to do. > > Neither could I. I vaguely remember having people mention it,

Re: [Python-3000] lambda

2008-03-25 Thread Georg Brandl
Benjamin Peterson schrieb: > Guido once said that he hadn't found a better name. Well, I think > that almost *any* name will do better! ;-) Especially a name that > emphasizes the fact that lambda construction are in fact functions. > This is what Guido repeats over and over again:

Re: [Python-3000] the release gods are angry at python

2008-03-26 Thread Georg Brandl
Thomas Heller schrieb: > Neal Norwitz schrieb: >> The next releases of 2.6/3.0 are planned for April 2, just over a week >> from now. There is much work that needs to be done. The buildbots >> are in a pretty sad state and the gods are seeing too much red. >> >> http://www.python.org/dev/build

Re: [Python-3000] lambda

2008-03-27 Thread Georg Brandl
Olivier Verdier schrieb: > > > On 26/03/2008, *Nick Coghlan* <[EMAIL PROTECTED] > > wrote: > > I think if I come across a keyword I didn't know in a language I was > learning, I'd look it up to find out what it means. > > > Yes but it doesn't look like a key

Re: [Python-3000] Types and classes

2008-04-02 Thread Georg Brandl
Guido van Rossum schrieb: > On Wed, Apr 2, 2008 at 3:03 PM, Amaury Forgeot d'Arc <[EMAIL PROTECTED]> > wrote: >> On Wed, Apr 2, 2008 at 11:57 PM, Paul Prescod <[EMAIL PROTECTED]> wrote: >> > But does anyone else find it odd that the types of some things are >> > classes and the classes of som

Re: [Python-3000] Equality of range objects

2008-04-09 Thread Georg Brandl
Anand Balachandran Pillai schrieb: > Still this seems like a bad thing to break backward compatibility with. > However I cannot really provide a use-case apart from what Benjamin > has said -> Teaching. It is not a common use-case to equate ranges > in code and that is bad coding anyway. > > Hopef

Re: [Python-3000] Implementing % formatting in terms of str.format()

2008-04-12 Thread Georg Brandl
Steven Bethard schrieb: > On Sat, Apr 12, 2008 at 8:26 AM, <[EMAIL PROTECTED]> wrote: >> >> Nick> That's exactly the problem though - while a 2to3 fixer can be >> Nick> written for a tiny subset of formatting calls (those that meet the >> Nick> constraints you gave)... >> >> In my per

Re: [Python-3000] range() issues

2008-04-26 Thread Georg Brandl
Benjamin Peterson schrieb: On Sat, Apr 26, 2008 at 1:49 PM, Facundo Batista <[EMAIL PROTECTED]> wrote: Which should the range() definition be, in your words? "A set of integers from start to stop skipping step." [ ... ] "Set" is definitely misleading -- it has no ordering. Georg -- Thus

  1   2   3   >