R. David Murray added the comment:
Heh. There was a discussion in issue 22106 about valid examples for using
'pass'. This case is analogous to the one I came up with.
for x in map(...):
pass
that avoids building a list.
Not that any of it is idiomatic, as you say.
--
nosy
Antoine Pitrou added the comment:
The whole example is bad and should be removed or replace with something else:
1. Using map() is an anti-pattern here, since the function results are not used.
2. To build a dictionary that maps the ordinals from 0 to 255 to their
character equivalents
Raymond Hettinger added the comment:
The whole example is bad and should be removed
or replace with something else:
I'm not sure there are ANY examples of operator.setitem that couldn't be done a
better way without it. How about we remove it and leave the examples for
things that people
Antoine Pitrou added the comment:
Le 10/08/2014 13:20, Raymond Hettinger a écrit :
Raymond Hettinger added the comment:
The whole example is bad and should be removed
or replace with something else:
I'm not sure there are ANY examples of operator.setitem that
couldn't
be done a better
Roundup Robot added the comment:
New changeset 9c250f34bfa3 by Raymond Hettinger in branch '3.4':
Issue #22180: Remove weak example
http://hg.python.org/cpython/rev/9c250f34bfa3
--
nosy: +python-dev
___
Python tracker rep...@bugs.python.org
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - fixed
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22180
___
To kind whom it may concern:
I want to draw a map using python, not really a map with full information,
just a get together of a series of small shapes to reflect land use.
The data is like below
1 2 2 3 3 22 3 3 1 1 21 1 1 1 3 33 3 3 3 4 1
Each number represents one land use type
Mark Lawrence added the comment:
@bjorn terribly sorry for the delay here :-( Would you be able to supply a
patch for this, including doc and unittest changes as appropriate?
--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 2.6, Python 3.1, Python 3.2, Python 3.3
Brett Cannon added the comment:
I never bothered to mention the iter* methods in the HOWTO, and since it
becomes very obvious very fast to tweak them I'm not going to worry about it
and add more complexity to the doc.
--
resolution: - wont fix
status: open - closed
Chris Angelico ros...@gmail.com wrote:
# Snapshot of keys:
for k in list(d):
if f(k): del d[k]
No extra loop at the end, no switching out and in of contents, just
one little change in the loop header. Obviously you don't want to do
this when you're deleting two out of three billion,
On 04/25/2014 10:53 AM, Charles Hixson wrote:
What is the proper way to delete selected items during iteration of a
map? What I want to do is:
for (k, v) in m.items():
if f(k):
# do some processing of v and save result elsewhere
del m[k]
But this gives (as should be expected
On 2014-04-26 12:25, Charles Hixson wrote:
I expect that I'll be deleting around 1/3 during
each iteration of the process...and then adding new ones back in.
There shouldn't be a really huge number of deletions on any
particular pass, but it will be looped through many times...
If you have
Charles Hixson wrote:
What is the proper way to delete selected items during iteration of a
map? What I want to do is:
for (k, v) in m.items():
if f(k):
# do some processing of v and save result elsewhere
del m[k]
But this gives (as should be expected
On Sat, 26 Apr 2014 12:25:27 -0700, Charles Hixson wrote:
On 04/25/2014 10:53 AM, Charles Hixson wrote:
What is the proper way to delete selected items during iteration of a
map? What I want to do is:
for (k, v) in m.items():
if f(k):
# do some processing of v and save result
On Sun, Apr 27, 2014 at 12:14 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
I think the two obviously good enough approaches are:
- save a to be deleted list, then delete those keys;
- copy the not to be deleted items into a new dict
For a small enough dict that the
In article 535c67e9$0$29965$c3e8da3$54964...@news.astraweb.com,
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
I think the two obviously good enough approaches are:
- save a to be deleted list, then delete those keys;
- copy the not to be deleted items into a new dict
There
What is the proper way to delete selected items during iteration of a
map? What I want to do is:
for (k, v) in m.items():
if f(k):
# do some processing of v and save result elsewhere
del m[k]
But this gives (as should be expected):
RuntimeError: dictionary changed size
On Sat, Apr 26, 2014 at 3:53 AM, Charles Hixson
charleshi...@earthlink.net wrote:
What is the proper way to delete selected items during iteration of a map?
What I want to do is:
for (k, v) in m.items():
if f(k):
# do some processing of v and save result elsewhere
del m[k
On 2014-04-25 18:53, Charles Hixson wrote:
What is the proper way to delete selected items during iteration of a
map? What I want to do is:
for (k, v) in m.items():
if f(k):
# do some processing of v and save result elsewhere
del m[k]
But this gives (as should
On 4/25/2014 2:04 PM, Matthew Barnett wrote:
On 2014-04-25 18:53, Charles Hixson wrote:
What is the proper way to delete selected items during iteration of a
map? What I want to do is:
for (k, v) in m.items():
if f(k):
# do some processing of v and save result elsewhere
On 2014-04-25 14:50, Terry Reedy wrote:
If you expect to delete more than half the keys *and* if there are
no other references to the dict, such that you need the particular
object mutated, this might be better.
If that's your precondition, then it might be better to do something
like
keep
Josh Rosenberg added the comment:
I think the suggestion is intended for how do I keep Python 2 semantics in
Python 3?, not how can I write my Python 2 code so it will run equivalently
in Python 3?
It wouldn't be a bad idea to point out that you can adopt Py3 semantics
initially so as to
New submission from Brett Cannon:
In Python 2.6 and newer you can import future_builtins and use everything from
there. In Python 2.5 it should be itertools.imap(). This is much cleaner than
the current suggestion at
https://docs.python.org/2/howto/pyporting.html#update-map-for-imbalanced
Jessica McKellar added the comment:
Thanks for the patch, Gareth.Rees!
The patch applies cleanly and the docs build cleanly with it. I visually
inspected the addition in the built HTML docs and it looks good.
= patch review
--
keywords: +needs review -patch
nosy: +jesstess
stage:
Roundup Robot added the comment:
New changeset 16c5d7c289c6 by Benjamin Peterson in branch '2.7':
note that future_builtin's map is not quite like python 3's (closes #19363)
http://hg.python.org/cpython/rev/16c5d7c289c6
--
nosy: +python-dev
resolution: - fixed
stage: patch review
only:
Note: In Python 3, map() does not accept None for the
function argument.
--
keywords: +patch
Added file: http://bugs.python.org/file34117/issue19363.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19363
A.M. Kuchling added the comment:
Gareth Rees: it doesn't look like you attached the patch mentioned in your
02/04 comment.
--
nosy: +akuchling
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19363
Nick Coghlan added the comment:
Switched to be a docs-only bug as Gareth suggested.
--
assignee: rhettinger - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, ncoghlan
resolution: wont fix -
stage: committed/rejected - needs patch
to the
documentation for future_builtins.map:
Note: In Python 3, map() does not accept None for the function
argument. (zip() can be used instead.)
--
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19363
Eric V. Smith added the comment:
I agree with Raymond: it would have been nice to do this, but it's too late.
Closing.
--
nosy: +eric.smith
resolution: - wont fix
stage: - committed/rejected
status: open - closed
___
Python tracker
Raymond Hettinger added the comment:
I agree with you in principle, but it is far too late in 2.7's development to
take away a capability.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19363
% of the strings I need to parse. I think I can live with the
non-reparsing of the map output, but can I get Python 3 to do the UseForeignDTD
thing?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19363
___
New submission from Gareth Rees:
In Python 2.7, future_builtins.map accepts None as its first (function)
argument:
Python 2.7.5 (default, Aug 1 2013, 01:01:17)
from future_builtins import map
list(map(None, range(3), 'ABC'))
[(0, 'A'), (1, 'B'), (2, 'C')]
But in Python 3.x
Changes by Jon Clements jon...@googlemail.com:
--
nosy: +joncle
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19363
___
___
Python-bugs-list
Ned Deily added the comment:
I agree with Richard's comments. The crash appears to be a result of an
unsupported usage of SQLite and one that Python can't really protect you from.
--
resolution: - invalid
stage: - committed/rejected
status: open - closed
New submission from Timothy O'Keefe:
If you run this code, you will get a segfault. If you a) remove the row factory
from the following code or b) use the standard library map() instead of
multiprocessing.Pool.map, then the code does not crash.
#!/usr/bin/env python
import sqlite3
import
Ned Deily added the comment:
What platform are you running on? Please run the following script in the same
environment as you get the segfault and report the results.
#!/usr/bin/env python
import multiprocessing
import platform
import sqlite3
import sys
print(sys.version)
(INSERT INTO stocks VALUES
('1992-01-06','SELL','AAPL',20,512.99))
c.execute(SELECT * FROM stocks)
## --- map fun over cursor (fun does little to nothing)
pool = mp.Pool(processes=mp.cpu_count())
rows = pool.map(fun, c)
def fun(row):
_ = len(row)
return row
if __name__
Richard Oudkerk added the comment:
Adding the line
features[0][0]
to the end of main() produces a segfault for me on Linux.
The FAQ for sqlite3 says that
Under Unix, you should not carry an open SQLite database across a
fork() system call into the child process. Problems will
this does *not* work with Python 2.7 as you suggested it would.
op = map(A.fun,l)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: unbound method fun() must be called with A instance as
first argument (got int instance instead)
This, however, does:
op = map(A(3).fun,l
Hi Joshua thanks!
I think you might not understand what Chris said.
Currently this does *not* work with Python 2.7 as you suggested it would.
op = map(A.fun,l)
Yeah actually that wouldn't work even in Python 3, since value attribute used
by fun has not been set.
It was my mistake
On 7 August 2013 09:33, Luca Cerone luca.cer...@gmail.com wrote:
To correct my example:
from multiprocessing import Pool
class A(object):
def __init__(self,x):
self.value = x
def fun(self,x):
return self.value**x
l = range(100)
p = Pool(4)
op = p.map(A(3).fun,
doesn't work neither in Python 2.7, nor 3.2 (by the way I can't use Python
3 for my application).
Are you using Windows? Over here on 3.3 on Linux it does. Not on 2.7 though.
No I am using Ubuntu (12.04, 64 bit).. maybe things changed from 3.2 to 3.3?
from multiprocessing import Pool
On 7 August 2013 11:10, Luca Cerone luca.cer...@gmail.com wrote:
I can't try it now, I'll let you know later if it works!
(Though just by reading I can't really understand what the code does).
Well,
from multiprocessing import Pool
from functools import partial
class A(object):
def
Joshua Landau wrote:
On 7 August 2013 11:10, Luca Cerone luca.cer...@gmail.com wrote:
I can't try it now, I'll let you know later if it works!
(Though just by reading I can't really understand what the code does).
Well,
from multiprocessing import Pool
from functools import partial
On 7 August 2013 15:46, Peter Otten __pete...@web.de wrote:
import copy_reg
import multiprocessing
import new
new is deprecated from 2.6+; use types.MethodType instead of
new.instancemethod.
def make_instancemethod(inst, methodname):
return getattr(inst, methodname)
This is just
Joshua Landau wrote:
On 7 August 2013 15:46, Peter Otten __pete...@web.de wrote:
def make_instancemethod(inst, methodname):
return getattr(inst, methodname)
This is just getattr -- you can replace the two uses of
make_instancemethod with getattr and delete this ;).
D'oh ;)
--
Thanks for the post.
I actually don't know exactly what can and can't be pickles..
not what partialing a function means..
Maybe can you link me to some resources?
I still can't understand all the details in your code :)
--
http://mail.python.org/mailman/listinfo/python-list
On 7 August 2013 23:26, Luca Cerone luca.cer...@gmail.com wrote:
Thanks for the post.
I actually don't know exactly what can and can't be pickles..
I just try it and see what works ;).
The general idea is that if it is module-level it can be pickled and
if it is defined inside of something
Thanks for the help Peter!
def make_instancemethod(inst, methodname):
return getattr(inst, methodname)
This is just getattr -- you can replace the two uses of
make_instancemethod with getattr and delete this ;).
D'oh ;)
--
)
p = Pool(4)
op = p.map(A.fun,l)
#using this with the normal map doesn't cause any problem
This fails because it says that the methods can't be pickled.
(I assume it has something to do with the note in the documentation:
functionality within this package requires that the __main__ module
On Tue, Aug 6, 2013 at 6:12 PM, Luca Cerone luca.cer...@gmail.com wrote:
from multiprocessing import Pool
class A(object):
def __init__(self,x):
self.value = x
def fun(self,x):
return self.value**x
l = range(10)
p = Pool(4)
op = p.map(A.fun,l)
Do you ever
):
self.value = x
def fun(self,x):
return self.value**x
l = range(10)
p = Pool(4)
op = p.map(A.fun,l)
#using this with the normal map doesn't cause any problem
This fails because it says that the methods can't be pickled.
(I assume
Hi Chris, thanks
Do you ever instantiate any A() objects? You're attempting to call an
unbound method without passing it a 'self'.
I have tried a lot of variations, instantiating the object, creating lambda
functions that use the unbound version of fun (A.fun.__func__) etc etc..
I have
Il 12/03/2013 16:58, Huseyin Emre Guner ha scritto:
Hello,
I am newbie in Python. I would like to make a project using python.
The main ideo of this project is that a user enters the x,y values to the Gui(PyQt or
Gtk) and then a 2-D map is plotted due to the x,y values. First, I use Pygame
Hello,
I am newbie in Python. I would like to make a project using python.
The main ideo of this project is that a user enters the x,y values to the
Gui(PyQt or Gtk) and then a 2-D map is plotted due to the x,y values. First, I
use Pygame commands (pygame.draw.line(window, (255, 255, 255), (10
New submission from py.user:
http://docs.python.org/3/library/mmap.html
examples use map as a name for the mmap object
--
assignee: docs@python
components: Documentation
messages: 184015
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In mmap doc
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
keywords: +easy
nosy: +ezio.melotti
stage: - needs patch
type: performance - enhancement
versions: +Python 2.7, Python 3.2, Python 3.4
___
Python tracker rep...@bugs.python.org
Aman Shah added the comment:
Corrected map - mymap.
--
keywords: +patch
nosy: +Aman.Shah
Added file: http://bugs.python.org/file29386/issue17402.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17402
py.user added the comment:
how about mm ?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17402
___
___
Python-bugs-list mailing list
Changes by py.user bugzilla-mail-...@yandex.ru:
Added file: http://bugs.python.org/file29390/mm.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17402
___
Roundup Robot added the comment:
New changeset c226133b1493 by Ezio Melotti in branch '2.7':
#17402: avoid shadowing built-in map in mmap examples. Initial patch by Aman
Shah.
http://hg.python.org/cpython/rev/c226133b1493
New changeset df27ea4bdebd by Ezio Melotti in branch '3.2':
#17402
Ezio Melotti added the comment:
Fixed, thanks for the report and the patches!
(py.user, if you specify your real name, next time I can give you credits too.)
--
assignee: docs@python - ezio.melotti
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
Hey, all! I've managed to get my project to a semi-playable state (everything
functions, if not precisely the way I'd like it to). One small issue is that
when the player movs from one level to the next, the items and monsters in the
previous level all 'reset' and return to the positions
the
player can drop an item and come back to it later.
Should I add something to the 'drop_item' function, or call soemthing
in make_map?
How many levels do you have and how much does each take up in memory? It
might be ok to to simply save the level in memory under its number; if
the map
On 8/12/12 22:32:22, Graham Fielding wrote:
Hey, all!
I've managed to get my project to a semi-playable state (everything
functions, if not precisely the way I'd like it to). One small issue is
that when the player moves from one level to the next, the items and
monsters in the previous
the item/monster locations so the
player can drop an item and come back to it later.
Make the level generation process two-step. Step 1, build the map.
Step 2, populate it with items and monsters. When the level is left,
save the state and positions of the items and monsters in it along
Roundup Robot added the comment:
New changeset 3c6d8461b09f by Benjamin Peterson in branch '3.2':
enumerate only requires an iterable (closes #16573)
http://hg.python.org/cpython/rev/3c6d8461b09f
New changeset 4ff17cf130eb by Benjamin Peterson in branch '3.3':
merge 3.2 (#16573)
Benjamin Peterson added the comment:
Thanks for the patch.
--
nosy: +benjamin.peterson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16573
___
___
sorted for zip, map, filter, dict,
xrange
type: behavior
Added file: http://bugs.python.org/file28152/enumerate.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16573
On Saturday, October 6, 2012 5:01:40 AM UTC+5:30, Devin Jeanpierre wrote:
On Fri, Oct 5, 2012 at 7:24 PM, Ian Kelly wrote:
I realize that. My point is that the function *feels* more like a
variant of reduce than of map.
If it's meant as a complaint, it's a poor one.
It's
Thanks to all who replied. Always good to learn something new.
P.S. A reader posted a good comment with Scala as well as Python code for a
compose function (basically same functionality as fmap, or more - the compose
once, run many times thing). It's the 4th comment on my blog post.
-
http://jugad2.blogspot.in/2012/10/fmap-inverse-of-python-map-function.html
- Vasudev Ram
www.dancingbison.com
jugad2.blogspot.com
twitter.com/vasudevram
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Oct 5, 2012 at 2:19 PM, vasudevram vasudev...@gmail.com wrote:
http://jugad2.blogspot.in/2012/10/fmap-inverse-of-python-map-function.html
Your fmap is a special case of reduce.
def fmap(functions, argument):
return reduce(lambda result, func: func(result), functions, argument
On Fri, Oct 5, 2012 at 3:31 PM, Ian Kelly ian.g.ke...@gmail.com wrote:
On Fri, Oct 5, 2012 at 2:19 PM, vasudevram vasudev...@gmail.com wrote:
http://jugad2.blogspot.in/2012/10/fmap-inverse-of-python-map-function.html
Your fmap is a special case of reduce.
def fmap(functions, argument
On Fri, Oct 5, 2012 at 5:31 PM, Ian Kelly ian.g.ke...@gmail.com wrote:
On Fri, Oct 5, 2012 at 2:19 PM, vasudevram vasudev...@gmail.com wrote:
http://jugad2.blogspot.in/2012/10/fmap-inverse-of-python-map-function.html
Your fmap is a special case of reduce.
So is map.
def map(f, seq
On Fri, Oct 5, 2012 at 4:52 PM, Devin Jeanpierre jeanpierr...@gmail.com wrote:
On Fri, Oct 5, 2012 at 5:31 PM, Ian Kelly ian.g.ke...@gmail.com wrote:
On Fri, Oct 5, 2012 at 2:19 PM, vasudevram vasudev...@gmail.com wrote:
http://jugad2.blogspot.in/2012/10/fmap-inverse-of-python-map
On Fri, Oct 5, 2012 at 7:24 PM, Ian Kelly ian.g.ke...@gmail.com wrote:
I realize that. My point is that the function *feels* more like a
variant of reduce than of map.
If it's meant as a complaint, it's a poor one.
It's not.
Fair enough all around. Sorry for misunderstanding.
-- Devin
Peter Inglesby added the comment:
Have attached a patch with suggested update.
Have also grepped for similar issues elsewhere in documentation, and haven't
found anything, but may have missed something.
--
keywords: +patch
nosy: +inglesp
Added file:
Chris Jerdonek added the comment:
2.7 is not affected.
--
assignee: docs@python - chris.jerdonek
versions: +Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16073
___
Roundup Robot added the comment:
New changeset 6c96878eb729 by Chris Jerdonek in branch '3.2':
Close issue #16073: fix map() example in list comprehension documentation.
http://hg.python.org/cpython/rev/6c96878eb729
New changeset 8a4a88b1e964 by Chris Jerdonek in branch 'default':
Close issue
Chris Jerdonek added the comment:
Thanks for helping with the patch and search, Peter.
--
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16073
New submission from Chris Jerdonek:
Date: Thu, 20 Sep 2012 15:14:36 -0400
To: d...@python.org
Subject: [docs] map objects are not lists
5.1.3. List
Comprehensionshttp://docs.python.org/dev/tutorial/datastructures.html#list-comprehensions
List comprehensions provide a concise way
Changes by Richard Oudkerk shibt...@gmail.com:
--
resolution: - duplicate
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15702
___
New submission from James Hutchison:
Following code deadlocks on Windows 7 64-bit, Python 3.2.3
If you have a pool issue a map operation over an empty iterable then try to
join later, it will deadlock. If there is no map operation or blah in the code
below isn't empty, it does not deadlock
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15702
___
___
Python-bugs-list mailing list
Jeff Knupp added the comment:
This is a duplicate of http://bugs.python.org/issue12157, which was fixed.
--
nosy: +Jeff.Knupp
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15702
___
On 25 June 2012 08:24, Stefan Behnel
stefan...@behnel.de wrote:
Saurabh Kabra, 25.06.2012 05:37:
I have written a script to map a 2D numpy array(A) onto another
array(B) of
different dimension. more than one element (of array A) are summed and
mapped to each element of array B
Saurabh Kabra, 25.06.2012 05:37:
I have written a script to map a 2D numpy array(A) onto another array(B) of
different dimension. more than one element (of array A) are summed and
mapped to each element of array B. To achieve this I create a list where I
store the index of array
On 25 June 2012 08:24, Stefan Behnel stefan...@behnel.de wrote:
Saurabh Kabra, 25.06.2012 05:37:
I have written a script to map a 2D numpy array(A) onto another array(B)
of
different dimension. more than one element (of array A) are summed and
mapped to each element of array B
). But I solved
that problem by simply adding zero elements to make a regular 3D numpy
array out of the list.
Saurabh
On 25 June 2012 08:24, Stefan Behnel stefan...@behnel.de wrote:
Saurabh Kabra, 25.06.2012 05:37:
I have written a script to map a 2D numpy array(A) onto another array(B
I have written a script to map a 2D numpy array(A) onto another array(B) of
different dimension. more than one element (of array A) are summed and
mapped to each element of array B. To achieve this I create a list where I
store the index of array A to be mapped to array B. The list
Richard Oudkerk shibt...@gmail.com added the comment:
Unless you have a reason why imap() does not solve the problem I will
eventually close the issue as rejected.
--
resolution: - rejected
stage: - committed/rejected
status: open - pending
___
andrew cooke and...@acooke.org added the comment:
hi - i'm the original author (may be using a different account). as far as i
remember, i raised this because it seemed relevant given the link i gave. if
you've looked at the issue and think your approach would work, or that this
should be
Richard Oudkerk shibt...@gmail.com added the comment:
I'll close then.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12897
___
Richard Oudkerk shibt...@gmail.com added the comment:
If you want lazy operation then you should use imap(f, it[, chunksize]) rather
than using map_async(f, it).
This will return an iterator rather than a list. Also, the iterator's next()
method has a timeout argument. (chunksize is the
New submission from Vladimir Berkutov dair.t...@gmail.com:
It might be useful to introduce a new map() and filter() methods to iterators
and iterables. Both methods should accept lambda/function which transforms a
single argument into value. Both methods should return another iterator
Ramchandra Apte maniandra...@gmail.com added the comment:
Sorry, small mistake.
Actually all the other Python 2.x releases are in security-fix mode.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14961
Ramchandra Apte maniandra...@gmail.com added the comment:
I think this is quite a major change to Python and this needs a PEP BTW
issue912738 and therefore this bug no longer applies to Python 3.
In Python 3 map returns an iterator.
Even if you wanted to implement this feature in Python 2
401 - 500 of 1178 matches
Mail list logo