Re: Static Map

2009-03-01 Thread KMCB
Andrew, You are correct, that article was very beneficial. It helped me understand the stack, much better. Thanks, kmcb -- http://mail.python.org/mailman/listinfo/python-list

Static Map

2009-02-28 Thread KMCB
Hello, I'm interested in creating a static map of a region in the US. This map would be set into a picture format, so I can add it to a document. I would like it to contain some town names and road information. Then I would like to add points, based on LAT and LONG, that can be labeled

Re: Static Map

2009-02-28 Thread Andrew MacIntyre
KMCB wrote: Hello, I'm interested in creating a static map of a region in the US. This map would be set into a picture format, so I can add it to a document. I would like it to contain some town names and road information. Then I would like to add points, based on LAT and LONG, that can

[issue5000] multiprocessing - Pool.map() slower about 5 times than map() on 2 cores machine

2009-01-19 Thread 0x666
': print testing multiprocessing on ,mul.cpu_count(),cores -- print elements = 10 pool = mul.Pool(processes=mul.cpu_count()) t1 = time() res_par = pool.map(f, range(elements)) t2 = time() res_seq = map(f, range(elements)) t3 = time

[issue5000] multiprocessing - Pool.map() slower about 5 times than map() on 2 cores machine

2009-01-19 Thread Jesse Noller
Changes by Jesse Noller jnol...@gmail.com: -- assignee: - jnoller nosy: +jnoller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5000 ___ ___

[issue5000] multiprocessing - Pool.map() slower about 5 times than map() on 2 cores machine

2009-01-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The multiprocessing module indeed has some overhead: - the processes are spawned when needed. Before you perform performance timings, you should warm up the Pool with a line like pool.map(f, range(mul.cpu_count())) (starting a

[issue5000] multiprocessing - Pool.map() slower about 5 times than map() on 2 cores machine

2009-01-19 Thread Jesse Noller
Jesse Noller jnol...@gmail.com added the comment: My results don't match yours. (8 cores, Mac OS/X): testing multiprocessing on 8 cores -- 10 elements map() time 0.0444118976593 s 10 elements pool.map() time 0.0366489887238 s 10 elements pool.apply_async() time

[issue5000] multiprocessing - Pool.map() slower about 5 times than map() on 2 cores machine

2009-01-19 Thread Jesse Noller
Jesse Noller jnol...@gmail.com added the comment: Closing as not an issue. -- resolution: - invalid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5000 ___

[issue5000] multiprocessing - Pool.map() slower about 5 times than map() on 2 cores machine

2009-01-19 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5000 ___ ___

[issue5000] multiprocessing - Pool.map() slower about 5 times than map() on 2 cores machine

2009-01-19 Thread 0x666
, first processes should be spawned, not waiting map function) or something like that. But it is only cosmetics :-) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5000

[issue4337] Iteration over a map object with list()

2008-11-21 Thread Terry J. Reedy
Terry J. Reedy [EMAIL PROTECTED] added the comment: Dict views and range objects are *iterables* because they are based on reusable information. Map, filter, and similar objects are *iterators* because they are based on iterables that could be once-through iterators. The built-in function

[issue4337] Iteration over a map object with list()

2008-11-17 Thread Jean-Michel Fauth
New submission from Jean-Michel Fauth [EMAIL PROTECTED]: win XP sp2, Py3.0c2 I had to face an annoying problem when iterating over a map object. With a range class, this works r = range(5) list(r) [0, 1, 2, 3, 4] With dict_keys/values/items objects, the following works d = {1: 'a', 2:'b

[issue4337] Iteration over a map object with list()

2008-11-17 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Feature :-) You will get the expected result if you skip the step where you ran the for-loop over r before running list(). Either listing or for-looping will exhaust the iterator. This is how iterators work. -- nosy: +rhettinger

[issue4337] Iteration over a map object with list()

2008-11-17 Thread Jean-Michel Fauth
personal reasonsquot; (bad habits?), I frequently fall in this trap.brbrgt;gt;gt; def plus(i):br nbsp;nbsp;nbsp; return i + 1brbrgt;gt;gt; list(map(plus, range(4)))br[1, 2, 3, 4]brgt;gt;gt; brbrRegardsbrbr ___ Python-bugs-list mailing list Unsubscribe

Re: Python 3.0b2 cannot map '\u12b'

2008-09-02 Thread Jukka Aho
Terry Reedy wrote: If the terminal expects cp437 then displaying utf-8 might give some problems. My screen displays whatever Windows tells the graphics card to tell the screen to display. In OpenOffice, I can select a unicode font that displays at least everything in the

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Terry Reedy
Tim Roberts wrote: josh logan [EMAIL PROTECTED] wrote: I am using Python 3.0b2. I have an XML file that has the unicode character '\u012b' in it, which, when parsed, causes a UnicodeEncodeError: 'charmap' codec can't encode character '\u012b' in position 26: character maps to undefined This

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Marc 'BlackJack' Rintsch
On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: I doubt the OP 'chose' cp437. Why does Python using cp437 even when the default encoding is utf-8? On WinXP sys.getdefaultencoding() 'utf-8' s='\u012b' s Traceback (most recent call last): File stdin, line 1, in module

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread josh logan
On Sep 1, 8:19 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: I doubt the OP 'chose' cp437.  Why does Python using cp437 even when the default encoding is utf-8? On WinXP   sys.getdefaultencoding() 'utf-8'   s='\u012b'  

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Terry Reedy
Marc 'BlackJack' Rintsch wrote: On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: I doubt the OP 'chose' cp437. Why does Python using cp437 even when the default encoding is utf-8? On WinXP sys.getdefaultencoding() 'utf-8' s='\u012b' s Traceback (most recent call last): File

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Marc 'BlackJack' Rintsch
On Mon, 01 Sep 2008 14:25:01 -0400, Terry Reedy wrote: Marc 'BlackJack' Rintsch wrote: On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: Most likely because Python figured out that the terminal expects cp437. What does `sys.stdout.encoding` say? The interpreter in the command prompt

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread Terry Reedy
Marc 'BlackJack' Rintsch wrote: First, thank you for the informative responses. The windows command prompt expects cp437 because that's what old DOS programs print to it. Grrr. When the interpreter runs, it opens the command prompt window with Python running, and the window closes when

Python 3.0b2 cannot map '\u12b'

2008-08-31 Thread josh logan
Hello, I am using Python 3.0b2. I have an XML file that has the unicode character '\u012b' in it, which, when parsed, causes a UnicodeEncodeError: 'charmap' codec can't encode character '\u012b' in position 26: character maps to undefined This happens even when I assign this character to a

Re: Python 3.0b2 cannot map '\u12b'

2008-08-31 Thread Tim Roberts
josh logan [EMAIL PROTECTED] wrote: I am using Python 3.0b2. I have an XML file that has the unicode character '\u012b' in it, which, when parsed, causes a UnicodeEncodeError: 'charmap' codec can't encode character '\u012b' in position 26: character maps to undefined This happens even when I

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread engelbert gruber
engelbert gruber [EMAIL PROTECTED] added the comment: and now it is 2.6 ? -- nosy: +grubert ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1513299 ___

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: May even be too late for 2.6. :) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1513299 ___ ___

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread engelbert gruber
engelbert gruber [EMAIL PROTECTED] added the comment: i just wanted to get rid of one python2.6 -3 warning in string and found that a patch was already waiting. from this thing i conclude smaller patches might get committed earlier , do they ? On Fri, Jul 18, 2008 at 8:42 PM, Georg Brandl

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: That is true. Barry might not want to allow a large catch-all patch; but since those changes are not adding new features, simple small ones can certainly get in before beta3. ___ Python tracker [EMAIL

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread engelbert gruber
engelbert gruber [EMAIL PROTECTED] added the comment: so i add a one liner replacing map(None with list ? On 7/18/08, Georg Brandl [EMAIL PROTECTED] wrote: Georg Brandl [EMAIL PROTECTED] added the comment: That is true. Barry might not want to allow a large catch-all patch; but since

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: I can replace those too. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1513299 ___ ___ Python-bugs-list

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread engelbert gruber
engelbert gruber [EMAIL PROTECTED] added the comment: it is only one in string.py, but then again it is save to do. thanks On 7/18/08, Georg Brandl [EMAIL PROTECTED] wrote: Georg Brandl [EMAIL PROTECTED] added the comment: I can replace those too.

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: OK, I nixed the simple uses of map(None, a). ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1513299

[issue1513299] Clean up usage of map() in the stdlib

2008-07-18 Thread engelbert gruber
PROTECTED] wrote: Georg Brandl [EMAIL PROTECTED] added the comment: OK, I nixed the simple uses of map(None, a). ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1513299

[issue2761] Doc: built-in callables and map

2008-05-05 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: Problem is, we already have a section Builtin types. Fixed the map() docs in r62738, and added a note to the first sentence in r62739. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2761

[issue2761] Doc: built-in callables and map

2008-05-04 Thread Terry J. Reedy
and classes in the sentence to introduce the generic term. This would at least slightly help the sometimes confusion between 'function' as specific class and as generic callable. This change also applies to 2.6 (and earlier, but oh, well...). 3.0 entry for map() (now a class!) in this section. Please add

[issue2761] Doc: built-in callables and map

2008-05-04 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Guido is doing 3.0 whatsnew. -- nosy: +benjamin.peterson, gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2761 __

[issue2761] Doc: built-in callables and map

2008-05-04 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: FWIW, I think the title is clearer as-is. While it is technically true that some entries are callables of various types, it is simpler to think of all of them as functions. The proposed change makes the docs harder to understand and

[issue2761] Doc: built-in callables and map

2008-05-04 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: I agree with Raymond here. -- resolution: - rejected status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2761 __

[issue2761] Doc: built-in callables and map

2008-05-04 Thread Terry J. Reedy
2 of 'built-in functions and [built-in] classes' is better. The map doc issues are, of course, separate from the title and lead sentence issue. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2761

Re: is hash map data structure available in Python?

2008-03-19 Thread Diez B. Roggisch
grbgooglefan schrieb: Hi, I have a situation that I need to search a name in a big list of names in my Python embedded interpreter. I am planning to use hash map for quicker search. How do I create hash map in Python? Can you please guide me to some documentation or tutorial which provides

is hash map data structure available in Python?

2008-03-19 Thread grbgooglefan
Hi, I have a situation that I need to search a name in a big list of names in my Python embedded interpreter. I am planning to use hash map for quicker search. How do I create hash map in Python? Can you please guide me to some documentation or tutorial which provides information on creating

Re: is hash map data structure available in Python?

2008-03-19 Thread sturlamolden
On 19 Mar, 09:40, grbgooglefan [EMAIL PROTECTED] wrote: How do I create hash map in Python? Python dictionaries are the fastest hash maps known to man. If you need persistent storage of your hash map, consider module bsddb or dbhash. -- http://mail.python.org/mailman/listinfo/python-list

Re: is hash map data structure available in Python?

2008-03-19 Thread Terry Reedy
sturlamolden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | On 19 Mar, 09:40, grbgooglefan [EMAIL PROTECTED] wrote: | | How do I create hash map in Python? | | Python dictionaries are the fastest hash maps known to man. If you only have keys (the names) and no values attached

Re: is hash map data structure available in Python?

2008-03-19 Thread 7stud
On Mar 19, 2:40 am, grbgooglefan [EMAIL PROTECTED] wrote: Hi, I have a situation that I need to search a name in a big list of names in my Python embedded interpreter. I am planning to use hash map for quicker search. How do I create hash map in Python? Can you please guide me to some

[issue2171] Add map, filter, zip to future_builtins

2008-03-18 Thread David Wolever
David Wolever [EMAIL PROTECTED] added the comment: Filter has been fixed in r61546. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2171 __ ___ Python-bugs-list mailing list

[issue2171] Add map, filter, zip to future_builtins

2008-03-18 Thread Benjamin Peterson
Changes by Benjamin Peterson [EMAIL PROTECTED]: -- nosy: +benjamin.peterson __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2171 __ ___ Python-bugs-list mailing list

[issue2171] Add map, filter, zip to future_builtins

2008-03-18 Thread David Wolever
David Wolever [EMAIL PROTECTED] added the comment: Ok, checked in the last piece -- fixer for filter -- in r61598. -- status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2171 __

[issue2360] Fixer for itertools.imap() - map()

2008-03-17 Thread Brett Cannon
New submission from Brett Cannon [EMAIL PROTECTED]: A fixer for converting itertools.imap() to - map() is needed. -- assignee: collinwinter components: 2to3 (2.x to 3.0 conversion tool) keywords: 26backport messages: 63736 nosy: brett.cannon, collinwinter priority: immediate severity

[issue2360] Fixer for itertools.imap() - map()

2008-03-17 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: -- priority: immediate - urgent __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2360 __ ___ Python-bugs-list mailing list

[issue2360] Fixer for itertools.imap() - map()

2008-03-17 Thread David Wolever
David Wolever [EMAIL PROTECTED] added the comment: I'll take this one (and the next few dealing with itertools) -- nosy: +David Wolever __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2360 __

[issue2360] Fixer for itertools.imap() - map()

2008-03-17 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: See also #2171. -- nosy: +georg.brandl __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2360 __ ___ Python-bugs-list

[issue2171] Add map, filter, zip to future_builtins

2008-03-17 Thread David Wolever
David Wolever [EMAIL PROTECTED] added the comment: To clarify, 2to3 shouldn't wrap map, filter, zip in list() if they are imported from future_builtins. -- nosy: +David Wolever __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2171

[issue2171] Add map, filter, zip to future_builtins

2008-03-17 Thread David Wolever
David Wolever [EMAIL PROTECTED] added the comment: The 2to3 stuff relating to map is added in r61479. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2171 __ ___ Python-bugs-list

[issue2360] Fixer for itertools.imap() - map()

2008-03-17 Thread David Wolever
David Wolever [EMAIL PROTECTED] added the comment: Fixed in r61466. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2360 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue2360] Fixer for itertools.imap() - map()

2008-03-17 Thread David Wolever
Changes by David Wolever [EMAIL PROTECTED]: -- nosy: -brett.cannon, collinwinter, georg.brandl status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2360 __

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-03-12 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Do you guys see any merit in changing the argument order for ifilter so that the predicate function can just be an optional argument: ifilter(data[, pred]) Alex Martelli successfully lobbied for groupby() to have that same argument

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-03-12 Thread Guido van Rossum
Guido van Rossum [EMAIL PROTECTED] added the comment: It would break the symmetry with map(). __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2186 __ ___ Python-bugs-list mailing

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-03-12 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Okay, thanks. Though, I should have also mentioned symmetries with sorted(), min(), and max() which all take the iterable first and follow with an optional key function. Closing this one. The map(None, *args) feature was removed for 3.0

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-03-12 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: It may be too late to express my opinion, but why symmetry with map is so important? There are several reasons why sequence, predicate order is natural for filter and function, sequence is a natural order for map. 1. In list

[issue2187] map and filter objects shouldn't call themselves itertools.imap and itertools.ifilter objects

2008-03-12 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Moved filter to builtins in r61536. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2187 __ ___ Python-bugs-list mailing

[issue2187] map and filter objects shouldn't call themselves itertools.imap and itertools.ifilter objects

2008-03-12 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Moved map to builtins in r61357. -- resolution: - fixed status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2187

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attached patch removes support for None from filter and itertools.ifilter. My objections for removing that from map do not apply because bool function can be used instead of None in filter achieving similar performance and better clarity. None support

[issue2187] map and filter objects shouldn't call themselves itertools.imap and itertools.ifilter objects

2008-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Can you assign this to Raymond as well? If this is done first, issue2186 patch will be simpler (at least in the documentation portion). The same question on the fate of ifilterfalse is pertinent here as well. -- nosy: +belopolsky

[issue2187] map and filter objects shouldn't call themselves itertools.imap and itertools.ifilter objects

2008-02-25 Thread Guido van Rossum
Changes by Guido van Rossum: -- assignee: - rhettinger nosy: +rhettinger __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2187 __ ___ Python-bugs-list mailing list

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Raymond Hettinger
function is bool(). +1 On removing the None argument from map() and imap(). It was hold-over from the days before zip(). __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2186

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Raymond, There must be a reason why we constantly disagree. Do you live in California by any chance? :-) I am not sure if map(None, ..) fate is still up for voting given your changes at r60206, but your own patch illustrates the problem that I

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I didn't disagree on filter(). Am taking your suggestion under advisement for a couple days. At this point, I'm leaning towards accepting the request (although with a different version of the patch). For map(None, ...), I happy to live with examples

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Raymond, it looks like you just broke the build for me: /Users/sasha/Work/python-svn/trunk/Modules/itertoolsmodule.c: In function 'ifilter_next': /Users/sasha/Work/python-svn/trunk/Modules/itertoolsmodule.c:2058: error: invalid operands to binary ==

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Alexander, please contact me directly at python at rcn dot com. Need to figure-out why this works on my build but not yours. There may be an include file issue. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2186

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: What do you guys think about just making the predicate argument optional? filter([-2,0,2]) -- -2, 2 filter(pred, iterable) One arg is the first case and two args is the second case. __ Tracker [EMAIL PROTECTED]

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: What do you guys think about just making the predicate argument optional? You've read my mind! That what I was going to suggest if I realized that optional argument does not have to be the last one. Looks like it would make sense to keep filterfalse

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Alexander Belopolsky
if some decision was made? Note that in msg55022 I said: If [the identity] proposal is accepted, it will make sense to deprecate the use of None as an identity function in map. So there may be no disagreement at all. __ Tracker [EMAIL PROTECTED] http

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Guido van Rossum
Guido van Rossum added the comment: What do you guys think about just making the predicate argument optional? filter([-2,0,2]) -- -2, 2 filter(pred, iterable) One arg is the first case and two args is the second case. -1. Apart from range() this is used nowhere else in Python.

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Okay. Will drop None in favor of bool() in ifilter and ifilterfalse. Also, it looks like there agreement on dropping None for map() and going forward with the operator.identity() patch. Will check these in in the next couple of days

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-24 Thread Guido van Rossum
New submission from Guido van Rossum: There are other ways of getting the same effects now (list() or zip() for map(None, ...)). -- keywords: easy messages: 62967 nosy: gvanrossum severity: normal status: open title: map and filter shouldn't support None as first argument (in Py3k only

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-24 Thread Guido van Rossum
Changes by Guido van Rossum: -- components: +Interpreter Core type: - behavior __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2186 __ ___ Python-bugs-list mailing list

[issue2187] map and filter objects shouldn't call themselves itertools.imap and itertools.ifilter objects

2008-02-24 Thread Guido van Rossum
New submission from Guido van Rossum: Probably ifilter and imap should go (moving the code over to bltinmodule.c). -- components: Interpreter Core keywords: easy messages: 62968 nosy: gvanrossum severity: normal status: open title: map and filter objects shouldn't call themselves

[issue2186] map and filter shouldn't support None as first argument (in Py3k only)

2008-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: In the absence of an identity function, map accepting None is useful in the cases like this: converters = {..} y = map(converters.get(c), x) That will now have to be rewritten as conv = converters.get(c) if conv is None: y = list(x) else: y = map

[issue2171] Add map, filter, zip to future_builtins

2008-02-23 Thread Georg Brandl
Changes by Georg Brandl: -- versions: +Python 2.6 -Python 3.0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2171 __ ___ Python-bugs-list mailing list Unsubscribe:

Re: Data mapper - need to map an dictionary of values to a model

2008-01-15 Thread bearophileHUGS
Luke: What design patterns would you use here? What about generator (scanner) with parameters? :-) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Data mapper - need to map an dictionary of values to a model

2008-01-15 Thread Luke
On Jan 15, 1:53 am, [EMAIL PROTECTED] wrote: Luke: What design patterns would you use here? What about generator (scanner) with parameters? :-) Bye, bearophile I'm not familiar with this pattern. I will search around, but if you have any links or you would like to elaborate, that would be

Re: Data mapper - need to map an dictionary of values to a model

2008-01-15 Thread bearophileHUGS
Luke: I'm not familiar with this pattern. I will search around, but if you have any links or you would like to elaborate, that would be wonderful. :) It's not a pattern, it's a little thing: def line_filter(filein, params): for line in filein: if good(line, params): yield

Re: Data mapper - need to map an dictionary of values to a model

2008-01-15 Thread George Sakkis
On Jan 14, 7:56 pm, Luke [EMAIL PROTECTED] wrote: I am writing an order management console. I need to create an import system that is easy to extend. For now, I want to accept an dictionary of values and map them to my data model. The thing is, I need to do things to certain columns: - I

Re: Data mapper - need to map an dictionary of values to a model

2008-01-15 Thread George Sakkis
On Jan 15, 6:53 pm, George Sakkis [EMAIL PROTECTED] wrote: name_tranformer = lambda input: dict( zip(('first_name', 'last_name'), input['name'])) Of course that should write: name_tranformer = lambda input: dict(

Re: Data mapper - need to map an dictionary of values to a model

2008-01-15 Thread Luke
On Jan 15, 3:53 pm, George Sakkis [EMAIL PROTECTED] wrote: On Jan 14, 7:56 pm, Luke [EMAIL PROTECTED] wrote: I am writing an order management console. I need to create an import system that is easy to extend. For now, I want to accept an dictionary of values and map them to my data model

Data mapper - need to map an dictionary of values to a model

2008-01-14 Thread Luke
I am writing an order management console. I need to create an import system that is easy to extend. For now, I want to accept an dictionary of values and map them to my data model. The thing is, I need to do things to certain columns: - I need to filter some of the values (data comes in as

Python routine decodes enceypted map image format - Program problem.

2007-12-14 Thread Independent
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in Python and in the intricacies of image files has written a routine to decode originally the UK

Python - Map decode routine problem?

2007-12-14 Thread james.duckworthy
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in Python and in the intricacies of image files has written a routine to decode originally the UK

Python - Map decode routine problem?

2007-12-14 Thread james.duckworthy
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in Python and in the intricacies of image files has written a routine to decode originally the UK

Re: Rewriting Recipe/410687 without map and lambda

2007-12-12 Thread sofeng
is an example of what I would like to do: | | Python 2.5.1 (r251:54863, May 18 2007, 16:56:43) | [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin | Type help, copyright, credits or license for more information. | a = [[1,2,3],[4,5,6,7],[8,9]] | print map(lambda *row: list

Rewriting Recipe/410687 without map and lambda

2007-12-11 Thread sofeng
, using dmd 0.125)] on cygwin Type help, copyright, credits or license for more information. a = [[1,2,3],[4,5,6,7],[8,9]] print map(lambda *row: list(row), *a) [[1, 4, 8], [2, 5, 9], [3, 6, None], [None, 7, None]] However, in the Python 3000 FAQ (http://www.artima.com/weblogs/ viewpost.jsp?thread

Re: Rewriting Recipe/410687 without map and lambda

2007-12-11 Thread Terry Reedy
(r251:54863, May 18 2007, 16:56:43) | [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin | Type help, copyright, credits or license for more information. | a = [[1,2,3],[4,5,6,7],[8,9]] | print map(lambda *row: list(row), *a) | [[1, 4, 8], [2, 5, 9], [3, 6, None], [None, 7, None

access.db : sendmail hash map file

2007-10-24 Thread equand
is there a way to open it? and edit? -- http://mail.python.org/mailman/listinfo/python-list

Newbie: Struggling again 'map'

2007-05-26 Thread mosscliffe
I thought I had the difference between 'zip' and 'map' sorted but when I try to fill missing entries with something other than 'None'. I do not seem to be able to get it to work - any pointers appreciated. Richard lista = ['a1', 'a2'] listb = ['b10', 'b11','b12' ,'b13'] for x,y in zip(lista

Re: Newbie: Struggling again 'map'

2007-05-26 Thread Dan Bishop
On May 26, 4:54 am, mosscliffe [EMAIL PROTECTED] wrote: I thought I had the difference between 'zip' and 'map' sorted but when I try to fill missing entries with something other than 'None'. I do not seem to be able to get it to work - any pointers appreciated. Richard lista = ['a1', 'a2

Re: Newbie: Struggling again 'map'

2007-05-26 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], mosscliffe wrote: for x,y in map(None, lista, listb): # Also fine - extends as expected print MAP:, x, x y, y for x,y in map(N/A, lista, listb): ## Fails - Can not call a 'str' print MAP:, x, x y, y def fillwith(fillchars): return

Re: Newbie: Struggling again 'map'

2007-05-26 Thread Roel Schroeven
mosscliffe schreef: for x,y in map(N/A, lista, listb): ## Fails - Can not call a 'str' print MAP:, x, x y, y def fillwith(fillchars): return fillchars for x,y in map(fillwith(N/A), lista, listb): ## Fails also - Can not call a 'str' print MAP:, x, x y, y

Re: Newbie: Struggling again 'map'

2007-05-26 Thread mosscliffe
] wrote: mosscliffe schreef: for x,y in map(N/A, lista, listb): ## Fails - Can not call a 'str' print MAP:, x, x y, y def fillwith(fillchars): return fillchars for x,y in map(fillwith(N/A), lista, listb): ## Fails also - Can not call a 'str' print MAP

Re: Newbie: Struggling again 'map'

2007-05-26 Thread George Sakkis
On May 26, 7:47 am, Roel Schroeven [EMAIL PROTECTED] wrote: mosscliffe schreef: for x,y in map(N/A, lista, listb): ## Fails - Can not call a 'str' print MAP:, x, x y, y def fillwith(fillchars): return fillchars for x,y in map(fillwith(N/A), lista, listb

Re: Newbie: Struggling again 'map'

2007-05-26 Thread 7stud
return value: result = calc() + 2 becomes: result = 3.5 + 2 3) map() and zip() perform two different tasks. zip() takes two(or more) sequences, and it returns a list of tuples, where each tuple consists of one element from each of the sequences: s1 = [1, 2, 3] s2 = [10, 20, 30, 40] print zip(s1

distance map

2007-04-25 Thread km
Hi all, Is there any module to make a network diagram given a 2-D matrix of distances ? any hints regards, KM -- http://mail.python.org/mailman/listinfo/python-list

<    3   4   5   6   7   8   9   10   11   12   >