On Sun, Jul 19, 2020 at 8:56 AM Marco Sulla
wrote:
>
> ... oh my ... Sure, thank you.
> Thinking positive, I wasted a lot of hours, but I discovered
> timeit.Timer.autorange
>
Nah... You *spent* a lot of hours, almost certainly enjoyably, and
along the way, you learned things! That's not wasted
x in dict", "stmt": "for x in it: pass", "setup": """
> > o = {k:k for k in range($size)}
> > it = o
> > """},
> > {"name": "for x in iter(dict)", "stmt": "for x
aningless :)
> benchmarks = (
> {"name": "for x in dict", "stmt": "for x in it: pass", "setup": """
> o = {k:k for k in range($size)}
> it = o
> """},
> {"name": "for x in iter
: 1.008e-05
Name: `for x in iter(dict)`;Size:8; Time: 1.845e-08
Name: `for x in iter(dict)`;Size: 1000; Time: 1.844e-08
Name: `iter(dict)`; Size:8; Time: 5.260e-08
Name: `iter(dict)`; Size: 1000; Time: 5.262e-08
Environment:
marco@buzz:~/sources/cpython
On 4/10/2019 3:17 PM, Arup Rakshit wrote:
From docs https://docs.python.org/3/library/itertools.html#itertools.chain I
see that itertools.chain is defined as a function.
Because that is what the itertools functions are. (The chain entry does
not use 'function', but the beginning of the doc do
On Thu, Apr 11, 2019 at 3:31 PM Gregory Ewing
wrote:
>
> Chris Angelico wrote:
> > At the moment, it isn't defined particularly as either a function or a
> > class,
>
> Well, it's listed under a section called "Functions", so the reader
> could be forgiven for assuming that it's a function.
Ah, f
Chris Angelico wrote:
At the moment, it isn't defined particularly as either a function or a
class,
Well, it's listed under a section called "Functions", so the reader
could be forgiven for assuming that it's a function. From a high
level point of view, it is -- you call it and it returns somet
On Thu, Apr 11, 2019 at 3:02 PM dieter wrote:
>
> Arup Rakshit writes:
> > From docs https://docs.python.org/3/library/itertools.html#itertools.chain
> > I see that itertools.chain is defined as a function.
>
> Maybe, it would have been better to state that "chain"
> is a "callable": something w
Arup Rakshit writes:
> From docs https://docs.python.org/3/library/itertools.html#itertools.chain I
> see that itertools.chain is defined as a function.
Maybe, it would have been better to state that "chain"
is a "callable": something which can be called on arguments.
For many people, "callable
Well. I thought so far, all class in python is defined as CamelCase. A function
can be a class to is something I am surprised. So does this mean, any callable
function if produce an instance is called class in Python?
Thanks,
Arup Rakshit
a...@zeit.io
> On 11-Apr-2019, at 12:53 AM, Calvin
Because it is. Many things are classes. calling itertools.chain(a, b)
creates an itertools.chain instance that you can iterate over. What else
did you think it would be?
On Wed, Apr 10, 2019 at 3:17 PM Arup Rakshit wrote:
> From docs https://docs.python.org/3/library/itertools.html#itertools.cha
>From docs https://docs.python.org/3/library/itertools.html#itertools.chain I
>see that itertools.chain is defined as a function. But then why
>inspect.isclass(chain) is saying it as class.
from itertools import chain
inspect.isclass(chain)
# True
Thanks,
Arup Rakshit
a...@zeit.io
--
htt
>def return_files(file_list):
>"""
>Take a list of files and return file when called.
>
>Calling function to supply attributes
>"""
>for file in file_list:
>with open(os.path.join(dir_path, file), 'rb') as fd:
>if os.stat(fd.name).st_size == 0:
>
Ah yes. Thanks ChrisA
http://www.tutorialspoint.com/python/python_loop_control.htm
The continue Statement:
The continue statement in Python returns the control to the beginning of the
while loop. The continue statement rejects all the remaining statements in the
current iteration of the loop an
On Wed, Dec 21, 2016 at 8:47 PM, Sayth Renshaw wrote:
> def return_files(file_list):
> """
> Take a list of files and return file when called.
>
> Calling function to supply attributes
> """
> for file in file_list:
> with open(os.path.join(dir_path, file), 'rb') as fd:
Hi
I am looping a list of files and want to skip any empty files.
I get an error that str is not an iterator which I sought of understand but
can't see a workaround for.
How do I make this an iterator so I can use next on the file if my test returns
true.
Currently my code is.
for dir_path, s
t use isinstance() with collections ABC classes.
Except objects that use the legacy __getitem__ iterator aren't
instances of collections.Iterable:
class C:
def __getitem__(self, index):
return index
o = C()
>>> isinstance(o, collections.Iterable)
On 14.11.16 02:40, Steve D'Aprano wrote:
I'm surprised that the inspect module doesn't appear to have isiterable and
isiterator functions. Here's my first attempt at both:
Just use isinstance() with collections ABC classes.
--
https://mail.python.org/mailman/listinfo/python-list
appears to just fall through. There doesn't
seem to be any special handling:
py> class X:
... def __iter__(self):
... raise TypeError("foo")
...
py> iter(X())
Traceback (most recent call last):
File "", line 1, in
File "", li
On Mon, Nov 14, 2016 at 3:54 PM, Steven D'Aprano
wrote:
>> Any particular reason to write it that way, rather than:
>>
>> def isiterable(obj):
>> try:
>> iter(obj)
>> return True
>> except TypeError:
>> return F
turn hasattr(T, '__iter__') or hasattr(T, '__getitem__')
>
> Any particular reason to write it that way, rather than:
>
> def isiterable(obj):
> try:
> iter(obj)
> return True
> except TypeError:
> return False
class BadIterab
arguments 0, 1, 2, 3 ... until an IndexError exception is
> raised (the Sequence Protocol).
>
> """
> T = type(obj)
> return hasattr(T, '__iter__') or hasattr(T, '__getitem__')
Any particular reason to write it that way, rather than:
de
On Mon, 14 Nov 2016 07:02 am, Antoon Pardon wrote:
>
> Some time ago I read a text or saw a video on iterators and one thing
> I remember from it, is that you should do something like the following
> when working with iterators, to avoid some pitt falls.
>
> def bar(iterat
On Mon, Nov 14, 2016 at 8:57 AM, Gregory Ewing
wrote:
> Antoon Pardon wrote:
>
>> def bar(iterator):
>> if iter(iterator) is iterator:
>> ...
>
>
> That's a way of finding out whether you can safely iterate
> over something more than onc
Antoon Pardon wrote:
def bar(iterator):
if iter(iterator) is iterator:
...
That's a way of finding out whether you can safely iterate
over something more than once. If the object is already an
iterator, applying iter() to it will return the same
object, and iterating over it
On Mon, Nov 14, 2016 at 7:02 AM, Antoon Pardon
wrote:
> Some time ago I read a text or saw a video on iterators and one thing
> I remember from it, is that you should do something like the following
> when working with iterators, to avoid some pitt falls.
>
> def bar(iterator)
Some time ago I read a text or saw a video on iterators and one thing
I remember from it, is that you should do something like the following
when working with iterators, to avoid some pitt falls.
def bar(iterator):
if iter(iterator) is iterator:
...
However I can't relocate i
Sayth Renshaw wrote:
def dataAttr(roots):
"""Get the root object and iter items."""
with open("output/first2.csv", 'w', newline='') as csvf:
race_writer = csv.writer(csvf, delimiter=',')
for meet in r
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.
Loving life.
I first started with a simple with open on a file, which allowed me to use code
that "iter"'s.
for example:
for meet in root.iter("m
On Sat, 1 Oct 2016 06:52 pm, Sayth Renshaw wrote:
> Evening
>
> My file list handler I have created a generator.
>
> Before I created it as a generator I was able to use iter on my lxml root
> objects, now I cannot iter.
lxml root objects have an iter method. Other objects d
need to be able to reference the node, how do I
> achieve this?
>
> Sayth
> --
Hi,
i think, you identified the problem correctly in the previous mail:
>> Before I created it as a generator I was able to use iter on my lxml root
>> objects, now I cannot iter.
It is not clear, what
My main issue is that usually its just x in ,,, for a generator.
But if I change the code
for meet in roots.iter("meeting"):
to
for meet in roots("meeting"):
Well its invalid but I need to be able to reference the node, how do I achieve
this?
Sayth
--
https://mail.python.org/mailman/listinfo/
Evening
My file list handler I have created a generator.
Before I created it as a generator I was able to use iter on my lxml root
objects, now I cannot iter.
± |master U:2 ?:1 ✗| → python3 race.py data/ -e *.xml
Traceback (most recent call last):
File "race.py", line 83, in
structure. That in turn depends on the
>history of additions and deletions.
Although I agree in general with your warning, you are factually
incorrect about dicts:
>>> d = {1:2, 3:4}
>>> i = iter(d)
>>> i.next()
1
>>> d[1] = 'foo'
>>> d
{1:
On Mon, 09 Aug 2010 09:11:37 -0700, daryn wrote:
> I'm just playing around with the iter function and I realize that I can
> use the iterator returned by it long after the original object has any
> name bound to it.
Yes, the same as everything else in Python. Iterators aren't
On 8/9/2010 12:11 PM, daryn wrote:
I'm just playing around with the iter function and I realize that I
can use the iterator returned by it long after the original object has
any name bound to it. Example:
a=[1,2,3,4]
b=iter(a)
b.next()
1
a[1]=99
Changing a list while iterating throu
daryn wrote:
> I'm just playing around with the iter function and I realize that I
> can use the iterator returned by it long after the original object has
> any name bound to it. Example:
>
>>>>a=[1,2,3,4]
>>>>b=iter(a)
>>>>b.next()
>
I'm just playing around with the iter function and I realize that I
can use the iterator returned by it long after the original object has
any name bound to it. Example:
>>>a=[1,2,3,4]
>>>b=iter(a)
>>>b.next()
1
>>>a[1]=99
>>>a[3]=101
>>
En Sun, 18 Oct 2009 23:07:40 -0200, Raymond Hettinger
escribió:
[Raymond]
> If it really is a sequence (with len and getitem), you can write your
> own indexing iterator:
> def myslice(seq, start, stop, step):
> 'Allow forward or backwards iteration over a subslice'
> for i in
[Raymond]
> > If it really is a sequence (with len and getitem), you can write your
> > own indexing iterator:
>
> > def myslice(seq, start, stop, step):
> > 'Allow forward or backwards iteration over a subslice'
> > for i in range(start, stop, step):
> > yield seq[i]
[S
's my inattention :-(. but
> what i could find the nearest thing is itertools.islice. but it can't
> process negative index -- that's supported by slice. so I need
> something, bind object with slice, and return a iter. I can find
> anything like it...:-(
If it really is
(. but
> > what i could find the nearest thing is itertools.islice. but it can't
> > process negative index -- that's supported by slice. so I need
> > something, bind object with slice, and return a iter. I can find
> > anything like it...:-(
>
> If it really is a seque
27;t
> process negative index -- that's supported by slice. so I need
> something, bind object with slice, and return a iter. I can find
> anything like it...:-(
If it really is a sequence (with len and getitem), you can write your
own indexing iterator:
def myslice(seq, start, stop, step)
StarWing wrote:
> I had checked it for serval times. maybe it's my inattention :-(. but
> what i could find the nearest thing is itertools.islice. but it can't
> process negative index
A negative index -n is an abbreviation for len(sequence) - n.
Since iterables in general do not have a length,
ion :-(. but
> what i could find the nearest thing is itertools.islice. but it can't
> process negative index -- that's supported by slice. so I need
> something, bind object with slice, and return a iter. I can find
> anything like it...:-(
Sorry, I read your post too quickly. I d
> # now a is a list, and a[:] is another list, and so a[m:n]
> > # now we do something with the 0~len(a)-3 elements of a
> > for val in a[:-2]:
> > #do something
>
> > but, this will cause a copy on a, has some convenience way to get a
> > iter to iterate
with the 0~len(a)-3 elements of a
> for val in a[:-2]:
> #do something
>
> but, this will cause a copy on a, has some convenience way to get a
> iter to iterate on a part of list?
>
> i made this:
> class iterslice:
> def __init__(self, list):
>
but, this will cause a copy on a, has some convenience way to get a
iter to iterate on a part of list?
i made this:
class iterslice:
def __init__(self, list):
self.list = list
def __len__(self):
return len(self.list)
def __getitem__(self, slice):
import
Il Thu, 02 Apr 2009 13:44:38 +, Sion Arrowsmith ha scritto:
> mattia wrote:
>> So, I'm looking for a way to "reset" the next() value every
>>time i complete the scan of a list.
>
> itertools.cycle ?
Perfect, thanks.
--
http://mail.python.org/mailman/listinfo/python-list
mattia wrote:
> So, I'm looking for a way to "reset" the next() value every
>time i complete the scan of a list.
itertools.cycle ?
--
\S
under construction
--
http://mail.python.org/mailman/listinfo/python-list
Il Sun, 29 Mar 2009 12:00:38 -0400, andrew cooke ha scritto:
> mattia wrote:
>>[i wrote]:
>>> don't you just want to have a new job machine?
>>>
>>> for job_list in job_list_list:
>>> job_machine = dict((x+1, iter(JOBS[x])) for x in range(N
mattia wrote:
>[i wrote]:
>> don't you just want to have a new job machine?
>>
>> for job_list in job_list_list:
>> job_machine = dict((x+1, iter(JOBS[x])) for x in range(NJOBS)) for x
>> in job_list:
>> print(next(job_machine[x]))
ok - btw you
job number and
>> an iterator associated by the list of machines: job_machine =
>> dict((x+1, iter(JOBS[x])) for x in range(NJOBS)) Now, something like:
>> for x in job_list:
>> print(next(job_machine[x]))
>> Works good, but imagine I have a list of job_list, now obv
I have a list of jobs and I want to have the associated list of
> machines, e.g:
> [JOB1, JOB1, JOB2] --> [3, 1, 2]
> My original idea was to have a dict with associated the job number and an
> iterator associated by the list of machines:
> job_machine = dict((x+1, iter(JOBS[x]))
of
machines, e.g:
[JOB1, JOB1, JOB2] --> [3, 1, 2]
My original idea was to have a dict with associated the job number and an
iterator associated by the list of machines:
job_machine = dict((x+1, iter(JOBS[x])) for x in range(NJOBS))
Now, something like:
for x in job_list:
print(n
Alan G Isaac <[EMAIL PROTECTED]> writes:
If I have a sequence, I can get every other or every fifth
element by slicing. Is there an equivalent for iterators?
On 10/15/2008 11:12 PM Paul Rubin apparently wrote:
itertools.islice
Oh, of course.
I'm a bit embarrassed not to have thought
to lo
Alan G Isaac <[EMAIL PROTECTED]> writes:
> If I have a sequence, I can get every other or every fifth
> element by slicing. Is there an equivalent for iterators?
itertools.islice
--
http://mail.python.org/mailman/listinfo/python-list
If I have a sequence, I can get every other or every fifth
element by slicing. Is there an equivalent for iterators?
More specifically, I want every fifth line of a big file.
What is the most efficient way to get them?
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
redibly useful pattern.
I often find myself converting sequences to iterators, so I can handle
both types identically:
def treat_first_item_specially(iterator_or_sequence):
it = iter(iterator_or_sequence)
try:
first_item(it.next)
except StopIteration:
pass
else
gt; def looper(a, b, c):
> > for a_ in a:
> > for b_ in b:
> > for c_ in c:
> > print a_, b_, c_
>
> > looper(a, b, c) # Intended behavior [1]
> > a, b, c = iter(a), b, iter(c) # b is intentionally not iter()-ed
> >
_, c_
looper(a, b, c) # Intended behavior [1]
a, b, c = iter(a), b, iter(c) # b is intentionally not iter()-ed
looper(a, b, c) # Inner StopIteration prematurely halt outer loop [2]
iterators are once-only objects. there's nothing left in "c" when you
enter the inner loop the second
b, c) # Intended behavior [1]
a, b, c = iter(a), b, iter(c) # b is intentionally not iter()-ed
looper(a, b, c) # Inner StopIteration prematurely halt outer loop [2]
[1]
1 1 1
1 1 2
... a very long result ...
3 4 4
3 4 5
[2]
1 1 1
1 1 2
1 1 3
1 1 4
1 1 5
Why is this behavior? Or is it a bug?
This
En Sun, 24 Feb 2008 10:18:31 -0200, Dustan <[EMAIL PROTECTED]>
escribió:
> On Feb 24, 5:11 am, gert <[EMAIL PROTECTED]> wrote:
>> what is the difference between iter(lambda:f.read(8192), ') and
>> iter(f.read(8192),'') ?
>
> iter(lambda:f.read
aha ok got it :)
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 24, 5:11 am, gert <[EMAIL PROTECTED]> wrote:
> what is the difference between iter(lambda:f.read(8192), ') and
> iter(f.read(8192),'') ?
One does not work, and one is syntactically incorrect:
>>> iter(f.read(8192),'')
Traceback (most rece
what is the difference between iter(lambda:f.read(8192), ') and
iter(f.read(8192),'') ?
--
http://mail.python.org/mailman/listinfo/python-list
thanks to Simon Forman,
his solution worked, the key value pairs were entered the wrong way
round in the dictionary...Doh!
--
Dr. Alistair King
Research Chemist,
Laboratory of Organic Chemistry,
Department of Chemistry,
Faculty of Science
P.O. Box 55 (A.I. Virtasen aukio 1)
FIN-00014 University
taleinat wrote:
> mappi.helsinki.fi> writes:
>
>
>> CDSitdict = {28.473823598317392: "'2.48699832'", 40.06163037274758:
>> "'0.2912'", 27.756248559438422: "'2.83499964'",
>> 33.2299196586726: "'1.12499962'", 29.989685187220061:
>> "'1.91399677'", 31.
Simon Forman wrote:
> [EMAIL PROTECTED] wrote:
>
>> Dear Python people,
>>
>> im a newbie to python and here...so hello!
>>
>
> Hi Ali, and welcome.
>
>
>> Im trying to iterate through values in a dictionary so i can find the
>> closest value and then extract the key for that valuewh
mappi.helsinki.fi> writes:
> CDSitdict = {28.473823598317392: "'2.48699832'", 40.06163037274758:
> "'0.2912'", 27.756248559438422: "'2.83499964'",
> 33.2299196586726: "'1.12499962'", 29.989685187220061:
> "'1.91399677'", 31.502319473614037: "'1.490
Something strange possessed Tim Chase and caused him to write:
> def findClosest(dataset, target):
[subtly *BUGGY* and overly verbose]
> def findClosest2(dataset, target):
[evil]
Try this (tested to the extent shown):
C:\junk>type dict_closest.py
def findClosest(dataset, target):
[snip]
def find
Quoting taleinat <[EMAIL PROTECTED]>:
> Ali writes:
>
> >> Im trying to iterate through values in a dictionary so i can find the
> >> closest value and then extract the key for that valuewhat ive done
> so far:
> >>
> >> def pcloop(dictionary, exvalue):
> >> z = dictionary.itervalues
[EMAIL PROTECTED] wrote:
> Dear Python people,
>
> im a newbie to python and here...so hello!
Hi Ali, and welcome.
> Im trying to iterate through values in a dictionary so i can find the
> closest value and then extract the key for that valuewhat ive done so far:
>
> def pcloop(dictionary, ex
Ali writes:
>> Im trying to iterate through values in a dictionary so i can find the
>> closest value and then extract the key for that valuewhat ive done so
>> far:
>>
>> def pcloop(dictionary, exvalue):
>> z = dictionary.itervalues()
>> y = z - exvalue
>> v = (y*y)*
[EMAIL PROTECTED] wrote:
> Im trying to iterate through values in a dictionary so i can find the
> closest value and then extract the key for that valuewhat ive done so far:
[snip]
> short time. I was trying to define a function (its my first!) so that i
> could apply to several 'dictionary's a
> Im trying to iterate through values in a dictionary so i can find the
> closest value and then extract the key for that valuewhat ive done so far:
>
> def pcloop(dictionary, exvalue):
> z = dictionary.itervalues()
> y = z - exvalue
> v = (y*y)**1/2
> if v < 0.
Dear Python people,
im a newbie to python and here...so hello!
Im trying to iterate through values in a dictionary so i can find the
closest value and then extract the key for that valuewhat ive done so far:
def pcloop(dictionary, exvalue):
z = dictionary.itervalues()
y = z
Will McGugan wrote:
> Hi,
>
> I've been using Python for years, but I recently encountered something
> in the docs I wasnt familar with. That is, using two arguements for
> iter(). Could someone elaborate on the docs and maybe show a typical use
> case for it?
>
&g
Will McGugan wrote:
> Hi,
>
> I've been using Python for years, but I recently encountered something
> in the docs I wasnt familar with. That is, using two arguements for
> iter(). Could someone elaborate on the docs and maybe show a typical use
> case for it?
>
&g
Will McGugan wrote:
> Hi,
>
> I've been using Python for years, but I recently encountered something
> in the docs I wasnt familar with. That is, using two arguements for
> iter(). Could someone elaborate on the docs and maybe show a typical use
> case for it?
>
&g
Hi,
I've been using Python for years, but I recently encountered something
in the docs I wasnt familar with. That is, using two arguements for
iter(). Could someone elaborate on the docs and maybe show a typical use
case for it?
Thanks,
Will McGugan
--
work: http://www.kelpiesoft.com
n't walked the relevant iter() code.
> That would be too easy ;-)
The actual code for Object/abstract.c's PyObject_GetIter() is somewhat more
straight-forward and less mysterious than those experiments suggest.
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
print "__getattr__:", attr
>... return getattr(args,attr)
>...
>py> class ClassicArgs:
>... def __getattr__(self, attr):
>... print "__getattr__:", attr
>... return getattr(args, attr)
>...
>py> c = ClassicArgs()
>p
ce_Check simply checks to
see if an object defines __getitem__ and that check entails an attribute lookup.
The posted code snippet uses a __getattr__ gimmick to supply an affirmative
answer to that check.
The docs do not make guarantees about how iter(o) will determine whether object
o is a sequence. C
return getattr(args, attr)
...
py> c = ClassicArgs()
py> i = c.__iter__()
__getattr__: __iter__
py> print i
py> i = iter(c)
__getattr__: __iter__
py> print i
py> a = Args()
py> i = a.__iter__()
__getattr__: __iter__
py> print i
py> i = iter(a)
Traceback (most recent call la
", attr
return getattr(args,attr)
class ClassicArgs:
def __getattr__(self, attr):
print "__getattr__:", attr
return getattr(args, attr)
if __name__ == '__main__':
c = ClassicArgs()
i = c.__iter__()
print i
i = iter(c)
print
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
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. Th
Steven Bethard <[EMAIL PROTECTED]> writes:
> 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 plac
some precedent. If it's
necessary to leave anything in itertools, my suggestion would be that
the documentation for the iter "type" have a clear "see also" link to
the itertools module.
One thing that might be worth keeping in mind is that some of
itertools functionality is
t such operations
should not be dumped into the builtin iter.
--
Ville Vainio http://tinyurl.com/2prnb
--
http://mail.python.org/mailman/listinfo/python-list
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
to fix the
Steven> documentation, not refuse to add builtin types.
Yep - that's why we should perhaps fix the documentation first :-).
Steven> I guess the real questions are[1]:
Steven> * How much does iter feel like a type?
Guess this depends on the person. I've never tho
is the only reason though, and even if it is, it might
not be entirely applicable because while the itertools functions may be
supplying alternate constructors, it's not clear why anyone would
subclass iter[2], so the constructors aren't likely to be inherited.
STeVe
[1] http://www.pyt
'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 doc, .fromkeys is the only dict method
>> that is a classmethod (better, t
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 staticme
"Terry Reedy" <[EMAIL PROTECTED]> 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 classm
Steven Bethard wrote:
Michael Spencer 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:
I personally don't much like the idea because I expect 'int'
"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)
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
1 - 100 of 118 matches
Mail list logo