Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-31 Thread Greg Ewing
Ville Vainio wrote: The issue that really bothers me here is bloating the builtin space. We already have an uncomfortable amount of builtin functions. Maybe what we're really after here is the notion of a builtin module that's pre-imported into the builtin namespace. -- Greg Ewing, Computer Science

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-31 Thread Greg Ewing
Steven Bethard wrote: I'd argue that for the same reasons that dict.fromkeys is a dict classmethod, the itertools methods could be iter classmethods (or staticmethods). The basic idea being that it's nice to place the methods associated with a type in that type's definiton. The parallel's a l

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-30 Thread Steven Bethard
Ville Vainio wrote: A minimal set would not be that offensive, yes. But then we would have two places to look for itertools functionality, which may not be desirable. True, though this is currently necessary with str objects if you want to use, say string.maketrans, so it's not without some prece

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-30 Thread Ville Vainio
> "Steven" == Steven Bethard <[EMAIL PROTECTED]> writes: Steven> Certainly a valid point. How would you feel about adding Steven> just a select few itertools functions, perhaps just Steven> islice, chain and tee? A minimal set would not be that offensive, yes. But then we would h

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-30 Thread Steven Bethard
Ville Vainio wrote: The issue that really bothers me here is bloating the builtin space. We already have an uncomfortable amount of builtin functions. Of course the additions that have been suggested would not pollute the builtin namespace, but they would still be there, taking space. I'd rather se

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Ville Vainio
> "Steven" == Steven Bethard <[EMAIL PROTECTED]> writes: Steven> to be documented as a builtin type. I don't find the Steven> argument "builtin type methods are hard to find" Steven> convincing -- the solution here is to fix the Steven> documentation, not refuse to add builtin

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Steven Bethard
Terry Reedy wrote: But if classmethods are intended to provide alternate constructors But I do not remember that being given as a reason for classmethod(). But I am not sure what was. Well I haven't searched thoroughly, but I know one place that it's referenced is in descrintro[1]: "Factoid: __

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Terry Reedy
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry Reedy wrote: >> "Steven Bethard" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>>True it's not a huge win. But I'd argue that for the same reasons that >>>dict.fromkeys is a dict classmeth

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Steven Bethard
Terry Reedy wrote: "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] True it's not a huge win. But I'd argue that for the same reasons that dict.fromkeys is a dict classmethod, the itertools methods could be iter classmethods (or staticmethods). As near as I could te

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Terry Reedy
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > True it's not a huge win. But I'd argue that for the same reasons that > dict.fromkeys is a dict classmethod, the itertools methods could be iter > classmethods (or staticmethods). As near as I could tell from the

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Bengt Richter
On Tue, 29 Mar 2005 11:32:33 -0800, Michael Spencer <[EMAIL PROTECTED]> wrote: [...] >While we're on the topic, what do you think of having unary, non-summary >builtins automatically map themselves when called with an iterable that would >otherwise be an illegal argument: That last "otherwise" is

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Jack Diederich
On Tue, Mar 29, 2005 at 12:38:42PM +0300, Ville Vainio wrote: > > "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: > > Raymond> If the experience works out, then all you're left with is > Raymond> the trivial matter of convincing Guido that function > Raymond> attributes

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread George Sakkis
"Steven Bethard" <[EMAIL PROTECTED]> wrote: > > [snip] > > I guess the real questions are[1]: > * How much does iter feel like a type? > * How closely are the itertools functions associated with iter? > > STeVe > > [1] There's also the question of how much you believe in OO tenets like > "functions

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Michael Spencer
Steven Bethard wrote: Ville Vainio wrote: "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: Raymond> If the experience works out, then all you're left with is Raymond> the trivial matter of convincing Guido that function Raymond> attributes are a sure cure for the burden of ty

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Steven Bethard
Ville Vainio wrote: "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: Raymond> If the experience works out, then all you're left with is Raymond> the trivial matter of convincing Guido that function Raymond> attributes are a sure cure for the burden of typing Raymond> impo

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Ville Vainio
> "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: Raymond> If the experience works out, then all you're left with is Raymond> the trivial matter of convincing Guido that function Raymond> attributes are a sure cure for the burden of typing Raymond> import statements.

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Raymond Hettinger
[Jack Diederich] > > itertools to iter transition, huh? I slipped that one in, I mentioned > > it to Raymond at PyCon and he didn't flinch. It would be nice not to > > have to sprinkle 'import itertools as it' in code. iter could also > > become a type wrapper instead of a function, so an it

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-28 Thread David Eppstein
In article <[EMAIL PROTECTED]>, Jack Diederich <[EMAIL PROTECTED]> wrote: > I only included making iter a type to make it more symmetric with str > being a type. iter is currently a function, as a practical matter I wouldn't > mind if it doubled as a namespace but that might make others flinch.

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-28 Thread Jack Diederich
On Mon, Mar 28, 2005 at 10:28:29AM -0700, Steven Bethard wrote: > Jack Diederich wrote: > > > > itertools to iter transition, huh? I slipped that one in, I mentioned > > it to Raymond at PyCon and he didn't flinch. It would be nice not to > > have to sprinkle 'import itertools as it' in code. it

itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-28 Thread Steven Bethard
Jack Diederich wrote: > > itertools to iter transition, huh? I slipped that one in, I mentioned > it to Raymond at PyCon and he didn't flinch. It would be nice not to > have to sprinkle 'import itertools as it' in code. iter could also > become a type wrapper instead of a function, so an iter in