Re: [Python-3000] More wishful thinking

2006-04-15 Thread Brian Harring
On Sat, Apr 15, 2006 at 10:32:21AM +, Talin wrote: > 2a) One particularly useful variation of *list (again, one which I have > brought up before, as have others), is the "yield *" syntax. The primary > use case is for chained generators, that is a generator that is yielding > the output of mult

Re: [Python-3000] Making strings non-iterable

2006-04-17 Thread Brian Harring
On Mon, Apr 17, 2006 at 05:40:19PM -0500, Ian Bicking wrote: > Raymond Hettinger wrote: > > -1 on making strings non-iterable. The cure is worse than the disease. > > I'm also -1 on almost all proposals of this kind. IMHO, the first cut > > of Py3000 should be directed at subtracting the cruf

Re: [Python-3000] Special object to return from functions that return only None

2006-04-19 Thread Brian Harring
On Tue, Apr 18, 2006 at 09:41:20PM -0400, Edward C. Jones wrote: > Wild idea. > > When I was a newbie, I repeatedly make the mistake of writing > > alist = alist.sort() > > I suggest a singleton object "UseForbidden" ("Py_UseForbidden" in C). > "UseForbidden" can be used only to return from a f

Re: [Python-3000] Is reference counting still needed?

2006-04-19 Thread Brian Harring
On Wed, Apr 19, 2006 at 03:07:50PM -0400, Tim Peters wrote: > and it matters. I noted this in public in 1999, after Neal > Schemenauer tried replacing all of Python's gc with BDW mark-sweep, > and reported: > > I started with Sam Rushing's patch and modified it for Python > 1.5.2c. To m

Re: [Python-3000] sets in P3K?

2006-04-28 Thread Brian Harring
On Fri, Apr 28, 2006 at 08:09:24AM -0400, Greg Wilson wrote: > OK, OK, just so I can get it off my chest: > > - introduce '@' as a prefix operator meaning 'freeze'. > > - [1, 2, 3] is a mutable sequence (our old friend the list) > > - {1, 2, 3} is a mutable set > > - @{1, 2, 3} is an immutable

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Brian Harring
On Mon, Nov 13, 2006 at 01:44:10PM -0500, George Sakkis wrote: > As a proof of concept, I provide below a sample implementation of how > I imagine this type to work (also posted in the original c.l.py. > thread): > > from itertools import chain, tee, islice > > import __builtin__ > _builtin_iter =

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

2007-02-15 Thread Brian Harring
On Thu, Feb 15, 2007 at 09:37:27PM -0800, Chris Rebert wrote: > Okay, in light of Guido's comments, alternate idea: > > We require all default values to be hash()-able, thus reasonably > ensuring their immutability. Offhand, that's a pretty arbitrary restriction- default __hash__ for objects is

Re: [Python-3000] Change to class construction?

2007-07-08 Thread Brian Harring
On Sat, Jul 07, 2007 at 01:08:15PM -0400, Terry Reedy wrote: > > "Nick Coghlan" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Georg is correct. A list comprehension like: > | > | [(x * y) for x in seq1 for y in seq2] > | > | expands to the following in 2.x (% prefixes the comp