[issue14961] map() and filter() methods for iterators

2012-05-30 Thread Ramchandra Apte
Ramchandra Apte maniandra...@gmail.com added the comment: Sorry, To clarify: Python 2.7 is in bug-fix mode which means only minor enhancements are allowed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14961

[issue14961] map() and filter() methods for iterators

2012-05-30 Thread Robert Lehmann
Robert Lehmann lehman...@gmail.com added the comment: Your proposal seems two-fold: (a) make map/filter lazy and (b) have them as methods instead of functions. It seems Tim borrowed Guido's time machine and already implemented (a) in Python 3.x, see http://docs.python.org/py3k/library

[issue14961] map() and filter() methods for iterators

2012-05-30 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: As Robert noted, the map() and filter() builtins in Python 3 are already lazy and there's no reason to expand the iterator protocol for this functionality. Map and filter also have dedicated syntax in the form of comprehensions and generator

Looking for Python script for Vector Map simplification, preserving shape and topology

2012-05-17 Thread David Shi
Dear All, I am looking for Python script for Vector Map simplification, preserving shape and topology. Please get in touch with davidg...@yahoo.co.uk    Regards. David -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for Python script for Vector Map simplification, preserving shape and topology

2012-05-17 Thread Simon Cropper
On 18/05/12 03:46, David Shi wrote: Dear All, I am looking for Python script for Vector Map simplification, preserving shape and topology. Please get in touch with davidg...@yahoo.co.uk Regards. David David, You really need to provide more information to get a specific answer; what

[issue12666] map semantic change not documented in What's New

2011-12-03 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 3b505df38fd8 by Jason R. Coombs in branch '3.2': Issue #12666: Clarifying changes in map for Python 3 http://hg.python.org/cpython/rev/3b505df38fd8 New changeset 0e2812b16f5f by Jason R. Coombs in branch '3.2

[issue12666] map semantic change not documented in What's New

2011-12-03 Thread Jason R. Coombs
Changes by Jason R. Coombs jar...@jaraco.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12666 ___

[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2011-11-16 Thread cedre.m
Changes by cedre.m cedr...@gmail.com: -- nosy: +cedrem ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7983 ___ ___ Python-bugs-list mailing list

[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2011-11-16 Thread cedre.m
cedre.m cedr...@gmail.com added the comment: http://support.microsoft.com/kb/170559/EN-US http://msdn.microsoft.com/en-us/goglobal/cc305152.aspx -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7983

Re: options for plotting points on geographic map

2011-10-01 Thread CM
On Sep 29, 12:52 pm, Miki Tebeka miki.teb...@gmail.com wrote: Probably the google maps routes will be faster (maybe using embedded webkit window). However it requires internet connection. See alsohttp://www.scipy.org/Cookbook/Matplotlib/Maps Thanks. But I just needed a small radius, not the

Re: options for plotting points on geographic map

2011-10-01 Thread CM
You could create the webpage and then render it in your desktop app. I have seen plenty of apps like that. That's a good idea. I was able to get the basics of the pymaps approach going, so I may do just this. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: options for plotting points on geographic map

2011-09-29 Thread Miki Tebeka
Probably the google maps routes will be faster (maybe using embedded webkit window). However it requires internet connection. See also http://www.scipy.org/Cookbook/Matplotlib/Maps HTH -- Miki Tebeka miki.teb...@gmail.com http://pythonwise.blogspot.com --

RE: options for plotting points on geographic map

2011-09-29 Thread Prasad, Ramit
I see there is pymaps, a Python wrapper for Google Maps. I may try that but it seems to be barely documented and would require making a webpage with javascript to display the map, whereas I'd probably prefer a desktop app for this--though I'd consider a web page (it's probably easier than I think

options for plotting points on geographic map

2011-09-28 Thread CM
Recommendations sought for using Python to plot points/custom markers (and maybe other things?) on a map of an area of the U.S. of maybe 100 miles radius. (This would be a political map showing towns, such as from Google Maps or Mapquest, and not a physical map). I'll need to place markers

[issue12897] Support for iterators in multiprocessing map

2011-09-05 Thread andrew cooke
and might be a useful extension. -- components: Library (Lib) messages: 143511 nosy: acooke priority: normal severity: normal status: open title: Support for iterators in multiprocessing map type: feature request versions: Python 3.4 ___ Python tracker

[issue12897] Support for iterators in multiprocessing map

2011-09-05 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Since it's a feature request, I would suggest to look whether it can apply to concurrent.futures instead. -- nosy: +pitrou versions: +Python 3.3 -Python 3.4 ___ Python tracker rep...@bugs.python.org

[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2011-08-24 Thread Nayuta Taga
Changes by Nayuta Taga ganaware+bugs.python@gmail.com: Removed file: http://bugs.python.org/file16301/cp932_roundtrip.tar.bz2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7983 ___

[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2011-08-24 Thread Nayuta Taga
Nayuta Taga ganaware+bugs.python@gmail.com added the comment: I have updated the tables about the latest Pythons (2.7.2, 3.2.1). The patches for 2.7a3 can be applied to 2.7.2 and 3.2.1 successfully. The latest Pythons still have the problem. Their encoding maps from Unicode to CP932 are

[issue12666] map semantic change not documented in What's New

2011-08-08 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: The content of the patch is very helpful, but I question its location: I’m not sure people will find this nugget in the 3.2+ version of the What’s New in Python 3.0 document (sorry for not bringing that up sooner). Maybe you could update

[issue12666] map semantic change not documented in What's New

2011-08-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I have reported the bugs to the metatracker. In the meantime, could you manually upload a diff? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12666

[issue12666] map semantic change not documented in What's New

2011-08-06 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: I'm attaching the diff at https://bitbucket.org/jaraco/cpython-issue12666/changeset/bc362109eed8 -- keywords: +patch Added file: http://bugs.python.org/file22848/cpython-issue12666-bc362109eed8.diff

[issue12666] map semantic change not documented in What's New

2011-08-05 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: (HTTPS repos are not supported) -- hgrepos: +51 nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12666 ___

[issue12666] map semantic change not documented in What's New

2011-08-05 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Can you provide a public URI? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12666 ___ ___

[issue12666] map semantic change not documented in What's New

2011-08-05 Thread Jason R. Coombs
Changes by Jason R. Coombs jar...@jaraco.com: -- keywords: +patch Added file: http://bugs.python.org/file22839/bc362109eed8.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12666 ___

[issue12666] map semantic change not documented in What's New

2011-08-05 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: I don't know how that repo got to be private; I created it just like every other public repo I have, and I thought I was only allowed one private repo (this was my second). In any case, I updated the setting, and now it appears to be

[issue12666] map semantic change not documented in What's New

2011-08-05 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: I'm not sure how the bugtracker patch mechanism works, but the patch it produced included a lot of changes that I didn't make (changesets already committed to the master repo). -- keywords: -patch

[issue12666] map semantic change not documented in What's New

2011-08-05 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12666 ___

[issue12666] map semantic change not documented in What's New

2011-08-05 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12666 ___ ___ Python-bugs-list

Map-based module imports with import hook

2011-08-01 Thread mpj
Hi, I've experience working at companies where, because of the network set up, having a long PYTHONPATH and searching it is quite a heavy task and can slow down the start up of the interpreter when there are lots of imports. As a proof of concept I wanted to look at a map-based approach

[issue12666] map semantic change not documented in What's New

2011-08-01 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: I've created a patch to address (1) and (2). Is there any value in also including this in the 2to3 fixer? I can see that it's a simple translation, but adds complexity to the converted code. I'd be content to go with just a documentation

[issue12666] map semantic change not documented in What's New

2011-07-31 Thread Jason R. Coombs
New submission from Jason R. Coombs jar...@jaraco.com: In `whatsnew/3.0.html`, there is little said about the map builtin: map() and filter() return iterators. If you really need a list, a quick fix is e.g. list(map(...)), but a better fix is often to use a list comprehension (especially when

[issue12666] map semantic change not documented in What's New

2011-07-31 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: I believe the correct solution to (2) is to use itertools.zip_longest. So to port to Python 3, the example would use: print(list(map(to_tuple, itertools.zip_longest([1,2,3], [4,5,6,7

[issue12506] NIS module cant handle multiple NIS map entries for the same GID

2011-07-07 Thread bjorn lofdahl
Changes by bjorn lofdahl bjorn.lofd...@gmail.com: -- versions: +Python 3.1, Python 3.2, Python 3.3, Python 3.4 -Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12506

[issue12506] NIS module cant handle multiple NIS map entries for the same GID

2011-07-07 Thread bjorn lofdahl
Changes by bjorn lofdahl bjorn.lofd...@gmail.com: -- versions: +Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12506 ___ ___

[issue12506] NIS module cant handle multiple NIS map entries for the same GID

2011-07-06 Thread bjorn lofdahl
: normal severity: normal status: open title: NIS module cant handle multiple NIS map entries for the same GID type: behavior versions: Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12506

Re: Functional Programing: stop using recursion, cons. Use map vectors

2011-05-24 Thread asandroq
On May 24, 12:27 am, Deeyana d.awlb...@hotmail.invalid wrote: Classic unsubstantiated and erroneous claim. Scheme does not come OOTB with any suitable libraries for host interop and though it can make calls to C libraries, doing so is awkward and involves difficulties with the impedance

Re: Functional Programing: stop using recursion, cons. Use map vectors

2011-05-24 Thread Chris Angelico
On Tue, May 24, 2011 at 8:27 AM, Deeyana d.awlberg@hotmail.invalid wrote: Classic unsubstantiated and erroneous claim. Scheme does not come OOTB with any suitable libraries for host interop and though it can make calls to C libraries, doing so is awkward and involves difficulties with the

Re: Functional Programing: stop using recursion, cons. Use map vectors

2011-05-24 Thread Deeyana
On Tue, 24 May 2011 13:39:15 -0700, asandroq wrote: On May 24, 12:27 am, Deeyana d.awlb...@hotmail.invalid wrote: Classic unsubstantiated and erroneous claim. Scheme does not come OOTB with any suitable libraries for host interop and though it can make calls to C libraries, doing so is

Re: Functional Programing: stop using recursion, cons. Use map vectors

2011-05-23 Thread asandroq
On May 23, 4:29 am, Deeyana d.awlb...@hotmail.invalid wrote: You might be interested in Clojure, then. Lists are more abstracted, like in Scheme, and vectors and also dictionaries/maps and sets are first class citizens along side lists. And unlike Scheme, Clojure has good library/host interop

Re: Functional Programing: stop using recursion, cons. Use map vectors

2011-05-23 Thread Pascal J. Bourguignon
torb...@diku.dk (Torben Ægidius Mogensen) writes: Xah Lee xah...@gmail.com writes: Functional Programing: stop using recursion, cons. Use map vectors. 〈Guy Steele on Parallel Programing〉 http://xahlee.org/comp/Guy_Steele_parallel_computing.html This is more or less what Backus said

Re: Functional Programing: stop using recursion, cons. Use map vectors

2011-05-23 Thread Antti J Ylikoski
On 23.5.2011 16:39, Pascal J. Bourguignon wrote: torb...@diku.dk (Torben Ægidius Mogensen) writes: Xah Leexah...@gmail.com writes: Functional Programing: stop using recursion, cons. Use map vectors. 〈Guy Steele on Parallel Programing〉 http://xahlee.org/comp

Re: Functional Programing: stop using recursion, cons. Use map vectors

2011-05-23 Thread Deeyana
On Mon, 23 May 2011 00:52:07 -0700, asandroq wrote: On May 23, 4:29 am, Deeyana d.awlb...@hotmail.invalid wrote: You might be interested in Clojure, then. Lists are more abstracted, like in Scheme, and vectors and also dictionaries/maps and sets are first class citizens along side lists. And

Functional Programing: stop using recursion, cons. Use map vectors

2011-05-22 Thread Xah Lee
this is important but i think most lispers and functional programers still don't know it. Functional Programing: stop using recursion, cons. Use map vectors. 〈Guy Steele on Parallel Programing〉 http://xahlee.org/comp/Guy_Steele_parallel_computing.html btw, lists (as cons, car, cdr

Re: Functional Programing: stop using recursion, cons. Use map vectors

2011-05-22 Thread Deeyana
On Sun, 22 May 2011 15:47:53 -0700, Xah Lee wrote: this is important but i think most lispers and functional programers still don't know it. Functional Programing: stop using recursion, cons. Use map vectors. 〈Guy Steele on Parallel Programing〉 http://xahlee.org/comp

Re: Simple map/reduce utility function for data analysis

2011-04-26 Thread Raymond Hettinger
On Apr 25, 7:42 pm, Paul Rubin no.em...@nospam.invalid wrote: Raymond Hettinger pyt...@rcn.com writes: Here's a handy utility function for you guys to play with:    http://code.activestate.com/recipes/577676/ Cute, but why not use collections.defaultdict for the return dict? Untested: My

Simple map/reduce utility function for data analysis

2011-04-25 Thread Raymond Hettinger
Here's a handy utility function for you guys to play with: http://code.activestate.com/recipes/577676/ Raymond twitter: @raymondh -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple map/reduce utility function for data analysis

2011-04-25 Thread Paul Rubin
Raymond Hettinger pyt...@rcn.com writes: Here's a handy utility function for you guys to play with: http://code.activestate.com/recipes/577676/ Cute, but why not use collections.defaultdict for the return dict? Untested: d = defaultdict(list) for key,value in

Re: Simple map/reduce utility function for data analysis

2011-04-25 Thread Steven D'Aprano
On Mon, 25 Apr 2011 16:48:42 -0700, Raymond Hettinger wrote: Here's a handy utility function for you guys to play with: http://code.activestate.com/recipes/577676/ Nice. That's similar to itertools.groupby except that it consolidates all the equal key results into one list, instead of

[issue11655] map() must not swallow exceptions from PyObject_GetIter

2011-03-27 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I agree with Ray. This is essentially a feature request which you say has already been implemented in Py 3 but which cannot go into Py2.7. Only fixes for bugs (discrepancies between doc and behavior) can go into 2.7. I suspect 2.6 and before

[issue11655] map() must not swallow exceptions from PyObject_GetIter

2011-03-24 Thread Ray.Allen
Ray.Allen ysj@gmail.com added the comment: There maybe compatibility issues which prevent such behavior change. -- nosy: +ysj.ray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11655 ___

[issue11655] map() must not swallow exceptions from PyObject_GetIter

2011-03-23 Thread Lukas Lueg
New submission from Lukas Lueg lukas.l...@gmail.com: The built-in function map() currently swallows any exception that might have occured while trying to get an iterator from any parameter. This produces unexpected behaviour for applications that require a certain type of exception

Re: enhanced map function

2011-03-17 Thread Patrick
as map([1, 2, 3, 4, 5, 6, 7], [8, 7, 6, 5, 4, 3, 2]) I don't expect the drop. The original nested structure is very important. What do you expect to happen if the sub-sequences don't match up exactly? E.g. a = [1, 2, [3, 4]]; b = [1, [2, 3], 4] What do you expect to happen if the shorter list

Re: enhanced map function

2011-03-17 Thread Steven D'Aprano
,[6,7,8],9,10]. You have misunderstood me. I'm not saying that you should force the users to clean up the data (although of course you could do that), but that you should do so before handing it to map. Rather than putting all the smarts into enhanced_map, and having it understand what to do

enhanced map function

2011-03-11 Thread Patrick
Hi, The build-in map functions looks quite nice but it requests the iterables to be of the same length or otherwises will file with None (most of time fails the function). Just wondering if there are already enhancement work done with it? I did some simple code but it will handle list without

Re: enhanced map function

2011-03-11 Thread Steven D'Aprano
On Fri, 11 Mar 2011 13:00:23 -0800, Patrick wrote: Hi, The build-in map functions looks quite nice but it requests the iterables to be of the same length or otherwises will file with None (most of time fails the function). Just wondering if there are already enhancement work done

Re: Map vs. List Comprehensions (was lint warnings)

2011-02-16 Thread Steven D'Aprano
On Tue, 15 Feb 2011 18:55:50 -0500, Gerald Britton wrote: So, what's the feeling out there? Go with map and the operators or stick with the list comps? Stick to whatever feels and reads better at the time. Unless you have profiled your code, and determined that the map or list comp

Map vs. List Comprehensions (was lint warnings)

2011-02-15 Thread Gerald Britton
Generally, I prefer map() over list comprehensions since they are more succinct and run faster for non-trivial examples. However, I've been considering another use case related to functions in the operator module. Here are some examples: [x.method() for x in data] [x[0] for x in data] [x.attr

Map Linux locale codes to Windows locale codes?

2010-12-14 Thread python
Is there a way to map Linux locale codes to Windows locale codes? Windows has locale codes like 'Spanish_Mexico'. We would like to use the more ISO compliant 'es_MX' locale format under Windows. Is there a resource or API that might help us with this mapping? Babel is not an option for us since

Re: Map Linux locale codes to Windows locale codes?

2010-12-14 Thread Flávio Lisbôa
you should do is to make up a dict with known LCID's and their corresponding language codes. I don't know of any way to do this automatically in python... Take a look at http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx 2010/12/14 pyt...@bdurham.com Is there a way to map Linux locale codes

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

2010-12-04 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Committed what was left applicable of the patch in r87020. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1513299

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

2010-11-27 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo -BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1513299 ___ ___

[issue10168] tkinter.Canvas.coords should return a list, not a map

2010-10-21 Thread Alexander Belopolsky
New submission from Alexander Belopolsky belopol...@users.sourceforge.net: Apparently a 2.x to 3.x migration artifact. Canvas.coords() is documented as returning a list: def coords(self, *args): Return a list of coordinates for the item given in ARGS. but in 3.x it returns a map

[issue10168] tkinter.Canvas.coords should return a list, not a map

2010-10-21 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- resolution: - duplicate stage: unit test needed - committed/rejected status: open - closed superseder: - changed return type from tkinter.Canvas.coords ___ Python tracker rep...@bugs.python.org

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

2010-07-16 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: msg69981 refers to #3390 which was closed fixed for has_key. As this is similar could this go into 3.2 subject to acceptance? The patch file is really a list of one line changes to get rid of map. -- nosy: +BreamoreBoy

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

2010-07-16 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I'll have a look. -- assignee: anthonybaxter - georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1513299 ___

Re: map is useless!

2010-06-07 Thread James Mills
On Mon, Jun 7, 2010 at 9:20 AM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: Ruby has a very nice map I'm thrilled for them. Personally I think the syntax is horrible. I concur! --James -- http://mail.python.org/mailman/listinfo/python-list

map is useless!

2010-06-06 Thread rantingrick
Everyone knows i'm a Python fanboy so nobody can call me a troll for this... Python map is just completely useless. For one it so damn slow why even bother putting it in the language? And secondly, the total girl- man weakness of lambda renders it completely mute! Ruby has a very nice map

Re: map is useless!

2010-06-06 Thread James Mills
On Mon, Jun 7, 2010 at 1:16 AM, rantingrick rantingr...@gmail.com wrote: So can anyone explain this poor excuse for a map function? Maybe GVR should have taken it out in 3.0?  *scratches head* Let me get this straight... You're complaining about some trivial code you've written and a 0.002

Re: map is useless!

2010-06-06 Thread Roald de Vries
On Jun 6, 2010, at 5:16 PM, rantingrick wrote: Everyone knows i'm a Python fanboy so nobody can call me a troll for this... Python map is just completely useless. For one it so damn slow why even bother putting it in the language? And secondly, the total girl- man weakness of lambda renders

Re: map is useless!

2010-06-06 Thread Duncan Booth
rantingrick rantingr...@gmail.com wrote: Python map is just completely useless. For one it so damn slow why even bother putting it in the language? And secondly, the total girl- man weakness of lambda renders it completely mute! Do you realise that you don't have to use lambda? If you need

Re: map is useless!

2010-06-06 Thread Alain Ketterlin
rantingrick rantingr...@gmail.com writes: Python map is just completely useless. [...] import time def test1(): l = range(1) t1 = time.time() map(lambda x:x+1, l) t2= time.time() print t2-t1 def test2(): l = range(1) t1 = time.time

Re: map is useless!

2010-06-06 Thread Shashwat Anand
map is not needed. LC is great :D On Sun, Jun 6, 2010 at 10:32 PM, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: rantingrick rantingr...@gmail.com writes: Python map is just completely useless. [...] import time def test1(): l = range(1) t1 = time.time

Re: map is useless!

2010-06-06 Thread rantingrick
On Jun 6, 12:02 pm, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: rantingrick rantingr...@gmail.com writes: I've not used map since I learned about list comprehensions. Thats has been my experienced also. Actually i've been at Python for O... about 2 years now and i don't think i've ever

Re: map is useless!

2010-06-06 Thread Lie Ryan
On 06/07/10 03:22, rantingrick wrote: On Jun 6, 12:02 pm, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: rantingrick rantingr...@gmail.com writes: I've not used map since I learned about list comprehensions. Thats has been my experienced also. Actually i've been at Python for O

Re: map is useless!

2010-06-06 Thread Thomas Jollans
On 06/06/2010 05:16 PM, rantingrick wrote: So can anyone explain this poor excuse for a map function? Maybe GVR should have taken it out in 3.0? *scratches head* Speaking of Py3k: map no longer builds lists. What once was map is no more, what once was itertools.imap is now map. Sometimes

Re: map is useless!

2010-06-06 Thread Richard Thomas
Python's map has the useful feature that nobody is in any doubt about what it does. I don't know much about Ruby I have to say but looking at that piece of syntax you gave I had no idea how to interpret it. Anyway, I looked it up. Calling an method on each of a collection of objects is best

Re: map is useless!

2010-06-06 Thread D'Arcy J.M. Cain
On Mon, 07 Jun 2010 05:27:43 +1000 Lie Ryan lie.1...@gmail.com wrote: In the most naive uses, map appears to have no advantage over list comprehension; but one thing that map can do that list comprehension still can't do without a walk around the park: def foo(func, args): g = lambda x

Re: map is useless!

2010-06-06 Thread Lie Ryan
On 06/07/10 05:54, D'Arcy J.M. Cain wrote: On Mon, 07 Jun 2010 05:27:43 +1000 Lie Ryan lie.1...@gmail.com wrote: In the most naive uses, map appears to have no advantage over list comprehension; but one thing that map can do that list comprehension still can't do without a walk around

Re: map is useless!

2010-06-06 Thread rantingrick
On Jun 6, 2:48 pm, Richard Thomas chards...@gmail.com wrote: Python's map has the useful feature that nobody is in any doubt about what it does. I don't know much about Ruby I have to say but looking at that piece of syntax you gave I had no idea how to interpret it. Anyway, I looked it up

Re: map is useless!

2010-06-06 Thread Terry Reedy
On 6/6/2010 11:16 AM, rantingrick wrote: Everyone knows i'm a Python fanboy so nobody can call me a troll for this... Non sequitor. It depends on your intention in posting this... Python map is just completely useless. For one it so damn slow Posting invalid speed comparisons stacked

Re: map is useless!

2010-06-06 Thread Steven D'Aprano
tests don't measure what you think they are measuring and consequently your results are invalid. Read on. Python map is just completely useless. For one it so damn slow why even bother putting it in the language? And secondly, the total girl- man weakness of lambda renders it completely mute

Re: map is useless!

2010-06-06 Thread D'Arcy J.M. Cain
On Mon, 07 Jun 2010 05:59:02 +1000 Lie Ryan lie.1...@gmail.com wrote: foo = lambda x: [y + 1 for y in x] [foo(x) for x in [[4, 6, 3], [6, 3, 2], [1, 3, 5]]] Didn't seem like such a long walk. that's because you're simplifying the problem, the correct walk is: Well, since it gives

Re: map is useless!

2010-06-06 Thread Lie Ryan
result as the original solution. def solution(lst): # make changes here only return foo(map, lst) def foo(func, args): g = lambda x: x+1 return [func(g, x) for x in args] import unittest @unittest.FunctionTestCase def test(): lst = [[4, 6, 3], [6, 3, 2], [1, 3, 5]] ans = [[5

Re: map is useless!

2010-06-06 Thread D'Arcy J.M. Cain
is a homework assignment, not a real requirements specification. def solution(lst): # make changes here only return foo(map, lst) OK, so I can make changes here. My change would not use foo. -- D'Arcy J.M. Cain da...@druid.net | Democracy is three wolves http

Re: map is useless!

2010-06-06 Thread Carl Banks
, your post only came off as slightly trollish, so you have that. Python map is just completely useless. For one it so damn slow why even bother putting it in the language? And secondly, the total girl- man weakness of lambda renders it completely mute! Ruby has a very nice map [1,2,3].map

Re: map is useless!

2010-06-06 Thread Terry Reedy
Reedy Python map is just completely useless. For one it so damn slow why even bother putting it in the language? And secondly, the total girl- man weakness of lambda renders it completely mute! Four trolls in three sentences. Way to go fanboy. (1) Completely useless? It can't do *anything

[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2010-05-30 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Hye-Shik, could you please comment on this ? The Windows version appears to replace private use code points with CJK compatibility idiographs, ie. uses standard Unicode code points rather than private escape code points (for round-trip

[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2010-05-23 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo, lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7983 ___ ___ Python-bugs-list

[issue7983] The encoding map from Unicode to CP932 is different from that of Windows'

2010-05-21 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7983 ___ ___

map, index

2010-03-28 Thread Luis Quesada
of writing the following without using zip: map(lambda (id,v):id*v,zip(range(len(L)),L)) I wonder whether there is something like mapInd in Oz (http://www.mozart-oz.org/documentation/base/list.html) so that you can pass a binary function to map and refer to the index of the element

Re: map, index

2010-03-28 Thread Duncan Booth
Luis Quesada l.ques...@4c.ucc.ie wrote: Is there a way of writing the following without using zip: map(lambda (id,v):id*v,zip(range(len(L)),L)) [ id*v for id,v in enumerate(L) ] -- http://mail.python.org/mailman/listinfo/python-list

Re: map, index

2010-03-28 Thread Luis Quesada
Duncan Booth wrote: Luis Quesada l.ques...@4c.ucc.ie wrote: Is there a way of writing the following without using zip: map(lambda (id,v):id*v,zip(range(len(L)),L)) [ id*v for id,v in enumerate(L) ] Cool! Thanks! Cheers, Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: map, index

2010-03-28 Thread Paul Rubin
Luis Quesada l.ques...@4c.ucc.ie writes: [ id*v for id,v in enumerate(L) ] Cool! Thanks! If you really want to write that in pointfree style (untested): import itertools, operator ... itertools.starmap(operator.mul, enumerate(L)) For your other question, you could probably do

Re: map, index

2010-03-28 Thread Luis Quesada
Paul Rubin wrote: Luis Quesada l.ques...@4c.ucc.ie writes: [ id*v for id,v in enumerate(L) ] Cool! Thanks! If you really want to write that in pointfree style (untested): import itertools, operator ... itertools.starmap(operator.mul, enumerate(L)) For your other question, you

imap vs map

2010-03-05 Thread mk
map(list, imap(itemgetter(1), gb)) === words.txt: === Word Aligned three space sensitive programming Feed Logo tins Essential Python post Reading List stop course there times isnt capes === Now, when I execute above, it works: [['capes', 'space'], ['aligned'], ['reading'], ['essential

Re: imap vs map

2010-03-05 Thread Arnaud Delobelle
=sorted) gb = groupby(sw, sorted) print map(list, imap(itemgetter(1), gb)) === words.txt: === Word Aligned three space sensitive programming Feed Logo tins Essential Python post Reading List stop course there times isnt capes === Now, when I execute above, it works: [['capes

Re: Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-10 Thread Rhodri James
On Tue, 09 Feb 2010 07:35:51 -, Gary Herron gher...@digipen.edu wrote: spike wrote: On Feb 8, 1:35 pm, Gary Herron gher...@islandtraining.com wrote: spike wrote: Has anyone been able to come across a Python logic map or Python logic flow chart? An example can be seen

Re: Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-09 Thread Jean-Michel Pichavant
Carl Banks wrote: On Feb 8, 12:20 pm, spike pwashingto...@gmail.com wrote: Has anyone been able to come across a Python logic map or Python logic flow chart? An example can be seen on the right under History:http://en.wikipedia.org/wiki/Usenet#History This would be very helpful for all

Re: Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-09 Thread Jean-Michel Pichavant
I use this one: Begin | | V Start Mail client | | V Ask python-list -+ | | | | Vwhat a bunch of dumbass wait 2 min| | | | | No. V | Did you get any answer

Re: Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-09 Thread Steve Holden
spike wrote: On Feb 8, 1:35 pm, Gary Herron gher...@islandtraining.com wrote: spike wrote: Has anyone been able to come across a Python logic map or Python logic flow chart? An example can be seen on the right under History: http://en.wikipedia.org/wiki/Usenet#History This would be very

<    1   2   3   4   5   6   7   8   9   10   >