Does anyone have a Python Logic Map/Flow Chart? (Example Provided)

2010-02-08 Thread spike
Has anyone been able to come across a Python logic map or flow chart? An example can be seen here on the right: http://en.wikipedia.org/wiki/Usenet This would be very helpful for users. -- http://mail.python.org/mailman/listinfo/python-list

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

2010-02-08 Thread spike
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 users. -- http://mail.python.org/mailman/listinfo/python-list

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

2010-02-08 Thread Gary Herron
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 helpful for all users. Huh??? What aspect of Python were you thinking

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

2010-02-08 Thread Carl Banks
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 users. Begin

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

2010-02-08 Thread Carl Banks
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 helpful

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

2010-02-08 Thread spike
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 helpful

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

2010-02-08 Thread Gary Herron
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

Trying to set up dictionary to map to functions

2009-12-08 Thread Randy Belt
to the dictionary and making it work? In the first set of code I don't reference the map at all but it still seems to know where to look? I am considerably new to Python -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set up dictionary to map to functions

2009-12-08 Thread Peter Otten
Randy Belt wrote: I have a small test program written trying to set up a dictionary that points keys to functions. It is working. However, in the process of creating it I noticed a weird problem. The problem is that this IS WORKING and I think it shouldn't be. ~ Here is the input config

Re: Trying to set up dictionary to map to functions

2009-12-08 Thread Dave Angel
'] Is this defaulting to the dictionary and making it work? In the first set of code I don't reference the map at all but it still seems to know where to look? I am considerably new to Python I don't blame you for being confused. You're doing two things wrong which has the side effect of making it seem

[issue1616979] cp720 encoding map

2009-11-16 Thread Alexander Belchenko
Alexander Belchenko bia...@users.sourceforge.net added the comment: As the author of original patch I want to note that it seems your merged patch does not update the documentation (list of standard encodings). Please, update the docs as well. --

[issue1616979] cp720 encoding map

2009-11-16 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I think it is, see r74006 and http://docs.python.org/dev/library/codecs.html#standard-encodings (this is the doc for the future 2.7 version) -- ___ Python tracker rep...@bugs.python.org

[issue1616979] cp720 encoding map

2009-11-16 Thread Alexander Belchenko
Alexander Belchenko bia...@users.sourceforge.net added the comment: OK, thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1616979 ___ ___

Re: substituting list comprehensions for map()

2009-11-04 Thread Tim Chase
Steven D'Aprano wrote: On Tue, 03 Nov 2009 22:43:45 -0600, Robert Kern wrote: Or use the appropriate libraries: from numpy import dot scalar = dot(vec1, vec2) Why would I want to use an already existing library that is fast, well- written and well-supported, when I can toss together a

Re: substituting list comprehensions for map()

2009-11-04 Thread Ben Finney
Steven D'Aprano ste...@remove.this.cybersource.com.au writes: On Tue, 03 Nov 2009 22:43:45 -0600, Robert Kern wrote: from numpy import dot scalar = dot(vec1, vec2) Why would I want to use an already existing library that is fast, well- written and well-supported, when I can toss

Re: substituting list comprehensions for map()

2009-11-04 Thread J Kenneth King
and express it accordingly. There's no need to clutter the mind with extra name bindings and iteration keywords. They won't make our idea any more clear. dot_product = map(mul, vec1, vec2) vs dot_product = [a * b for a, b in zip(vec1, vec2)] It's very clear, at least to me, what a dot

Python 3 [was Re: substituting list comprehensions for map()]

2009-11-04 Thread Steven D'Aprano
On Wed, 04 Nov 2009 23:08:54 +1100, Ben Finney wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes: On Tue, 03 Nov 2009 22:43:45 -0600, Robert Kern wrote: from numpy import dot scalar = dot(vec1, vec2) Why would I want to use an already existing library that is fast,

Re: substituting list comprehensions for map()

2009-11-03 Thread Anh Hai Trinh
Yes, just about any ‘map()’ operation has a corresponding list comprehension. (Does anyone know of a counter-example, a ‘map()’ operation that doesn't have a correspondingly simple list comprehension?) Try turning this into a list comprehension: vectorsum = lambda *args: map(sum, zip(*args

Re: substituting list comprehensions for map()

2009-11-03 Thread Steven D'Aprano
with extra name bindings and iteration keywords. They won't make our idea any more clear. dot_product = map(mul, vec1, vec2) vs dot_product = [a * b for a, b in zip(vec1, vec2)] It's very clear, at least to me, what a dot-product is in this case. Except it's not. The dot product of two

Re: substituting list comprehensions for map()

2009-11-03 Thread Robert Kern
of each element in a vector sequence. What you need is to define a function dot-product, and not hijack the name for a local value. Then the function's implementation is irrelevant to you: it could use a list comp, or could use map, it could use a for- loop, a while loop, recursion, or black

Re: substituting list comprehensions for map()

2009-11-03 Thread Steven D'Aprano
in this case. A dot product is simply the multiplication of each element in a vector sequence. What you need is to define a function dot-product, and not hijack the name for a local value. Then the function's implementation is irrelevant to you: it could use a list comp, or could use map

Re: substituting list comprehensions for map()

2009-11-02 Thread Javier Collado
] and resultlist will become [6,6,6,6,6].  Using map(), I can do: map(lambda op1,op2: op1 + op2, operandlist1, operandlist2) Is there any reasonable way to do this via a list comprehension ? -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

Re: substituting list comprehensions for map()

2009-11-02 Thread Chris Rebert
On Mon, Nov 2, 2009 at 12:54 AM, Jon P. jbpe...@gmail.com wrote: I'd like to do: resultlist = operandlist1 + operandlist2 where for example operandlist1=[1,2,3,4,5] operandlist2=[5,4,3,2,1] and resultlist will become [6,6,6,6,6].  Using map(), I can do: map(lambda op1,op2: op1 + op2

Re: substituting list comprehensions for map()

2009-11-02 Thread Steven D'Aprano
On Sun, 01 Nov 2009 23:54:16 -0800, Jon P. wrote: I'd like to do: resultlist = operandlist1 + operandlist2 where for example operandlist1=[1,2,3,4,5] operandlist2=[5,4,3,2,1] and resultlist will become [6,6,6,6,6]. Using map(), I can do: map(lambda op1,op2: op1 + op2

Re: substituting list comprehensions for map()

2009-11-02 Thread Paul Rudin
Jon P. jbpe...@gmail.com writes: I'd like to do: resultlist = operandlist1 + operandlist2 where for example operandlist1=[1,2,3,4,5] operandlist2=[5,4,3,2,1] and resultlist will become [6,6,6,6,6]. Using map(), I can do: map(lambda op1,op2: op1 + op2, operandlist1, operandlist2

Re: substituting list comprehensions for map()

2009-11-02 Thread Ben Finney
original lists). map(lambda op1,op2: op1 + op2, operandlist1, operandlist2) Is there any reasonable way to do this via a list comprehension ? Yes, just about any ‘map()’ operation has a corresponding list comprehension. (Does anyone know of a counter-example, a ‘map()’ operation that doesn't

Re: substituting list comprehensions for map()

2009-11-02 Thread Bruno Desthuilliers
Ben Finney a écrit : (snip) Yes, just about any ‘map()’ operation has a corresponding list comprehension. Right AFAICT, but: (Does anyone know of a counter-example, a ‘map()’ operation that doesn't have a correspondingly simple list comprehension?) ... depends on your definition of simple

Re: substituting list comprehensions for map()

2009-11-02 Thread Neil Crighton
Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au writes: operandlist1=[1,2,3,4,5] operandlist2=[5,4,3,2,1] and resultlist will become [6,6,6,6,6]. Using map(), I can do: map(lambda op1,op2: op1 + op2, operandlist1, operandlist2) If the two lists are very large

Re: substituting list comprehensions for map()

2009-11-02 Thread Diez B. Roggisch
Steven D'Aprano schrieb: On Sun, 01 Nov 2009 23:54:16 -0800, Jon P. wrote: I'd like to do: resultlist = operandlist1 + operandlist2 where for example operandlist1=[1,2,3,4,5] operandlist2=[5,4,3,2,1] and resultlist will become [6,6,6,6,6]. Using map(), I can do: map(lambda op1,op2: op1

Re: substituting list comprehensions for map()

2009-11-02 Thread Ben Finney
Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid writes: Ben Finney a écrit : (Does anyone know of a counter-example, a ‘map()’ operation that doesn't have a correspondingly simple list comprehension?) ... depends on your definition of simple. There are things I'd rather

Re: substituting list comprehensions for map()

2009-11-02 Thread Bruno Desthuilliers
Ben Finney a écrit : Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid writes: Ben Finney a écrit : (Does anyone know of a counter-example, a ‘map()’ operation that doesn't have a correspondingly simple list comprehension?) ... depends on your definition of simple

Re: substituting list comprehensions for map()

2009-11-02 Thread J Kenneth King
]. Using map(), I can do: map(lambda op1,op2: op1 + op2, operandlist1, operandlist2) If the two lists are very large, it would be faster to use this: from operator import add map(add, operandlist1, operandlist2) This is the best solution so far. Is there any reasonable way to do this via

Re: substituting list comprehensions for map()

2009-11-02 Thread Ben Finney
J Kenneth King ja...@agentultra.com writes: Steven D'Aprano ste...@remove.this.cybersource.com.au writes: from operator import add map(add, operandlist1, operandlist2) This is the best solution so far. Strange to say it's a solution, when it doesn't solve the stated problem: to replace

Re: substituting list comprehensions for map()

2009-11-02 Thread Steven D'Aprano
On Tue, 03 Nov 2009 09:14:05 +1100, Ben Finney wrote: J Kenneth King ja...@agentultra.com writes: Steven D'Aprano ste...@remove.this.cybersource.com.au writes: from operator import add map(add, operandlist1, operandlist2) This is the best solution so far. Strange to say it's

Re: substituting list comprehensions for map()

2009-11-02 Thread Steven D'Aprano
‘resultlist’ to a new list that is the *concatenation* of the two original lists). True, but it is valid mathematical syntax if you interpret lists as vectors. I'm sure there are languages where [1,2]+[3,4] will return [4,6]. Possibly R or Mathematica? Yes, just about any ‘map()’ operation has

Re: substituting list comprehensions for map()

2009-11-02 Thread Anh Hai Trinh
On the other hand, list comps using an if clause can't be written as pure maps. You can do this: [func(x) for x in seq if cond(x)] filter(cond, map(func, seq)) but the second version may use much more temporary memory if seq is huge and cond very rarely true. You could use ifilter, imap

Re: substituting list comprehensions for map()

2009-11-02 Thread Anh Hai Trinh
Try turning this into a list comprehension:   vectorsum = lambda *args: map(sum, zip(*args))   vectorsum([1,2], [3,4], [5,6]) -[9, 12]   vectorsum([1,2], [3,4], [5,6], [7,8]) -[16, 20] Nvm, it's actually easy: vectorsum = lambda *args: [sum(i) for i in zip(*args)] -- http

Re: substituting list comprehensions for map()

2009-11-02 Thread Ben Finney
]. Possibly R or Mathematica? Python isn't one of them, which is why I cautioned strongly against presenting it that way in this forum. Everyone forgets the multiple argument form of map. map(func, s1, s2, s3, ...) would need to be written as: [func(t) for f in itertools.izip_longest(s1, s2, s3

Re: substituting list comprehensions for map()

2009-11-02 Thread Ben Finney
Anh Hai Trinh anh.hai.tr...@gmail.com writes: Yes, just about any ‘map()’ operation has a corresponding list comprehension. (Does anyone know of a counter-example, a ‘map()’ operation that doesn't have a correspondingly simple list comprehension?) Try turning this into a list

Re: substituting list comprehensions for map()

2009-11-02 Thread Steven D'Aprano
On Mon, 02 Nov 2009 20:06:51 -0800, Anh Hai Trinh wrote: Yes, just about any ‘map()’ operation has a corresponding list comprehension. (Does anyone know of a counter-example, a ‘map()’ operation that doesn't have a correspondingly simple list comprehension?) Try turning this into a list

Re: substituting list comprehensions for map()

2009-11-02 Thread Sean DiZazzo
On Nov 2, 9:01 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Anh Hai Trinh anh.hai.tr...@gmail.com writes: Yes, just about any ‘map()’ operation has a corresponding list comprehension. (Does anyone know of a counter-example, a ‘map()’ operation that doesn't have a correspondingly

substituting list comprehensions for map()

2009-11-01 Thread Jon P.
I'd like to do: resultlist = operandlist1 + operandlist2 where for example operandlist1=[1,2,3,4,5] operandlist2=[5,4,3,2,1] and resultlist will become [6,6,6,6,6]. Using map(), I can do: map(lambda op1,op2: op1 + op2, operandlist1, operandlist2) Is there any reasonable way to do this via

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Florian Mayer
Florian Mayer florma...@aim.com added the comment: I dare to disagree on this being an adequate fix. Request to reopen. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7203 ___

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2009/10/27 Florian Mayer rep...@bugs.python.org: Florian Mayer florma...@aim.com added the comment: I dare to disagree on this being an adequate fix. Request to reopen. What would you prefer? --

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Florian Mayer
Florian Mayer florma...@aim.com added the comment: At least converting map(None, a, b, ...) to map(lambda *xs: xs, a, b, ...) I can understand if you prefer not to add the itertools.zip_longest workaround, although that would be the correct translation, of course

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2009/10/27 Florian Mayer rep...@bugs.python.org: Florian Mayer florma...@aim.com added the comment: At least converting map(None, a, b, ...) to map(lambda *xs: xs, a, b, ...) Well, since that's not always correct, we should

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Florian Mayer
Florian Mayer florma...@aim.com added the comment: When could this possibly be wrong, if I may ask? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7203 ___

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-26 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Fixed in r75734. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7203

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-25 Thread Georg Brandl
New submission from Georg Brandl ge...@python.org: Currently, ``map(None, a)`` is recognized and converted to ``list(a)`` which is correct but quite useless. ``map(None, a, b, ...)`` is not treated specially. An approximate translation would be ``map(lambda *xs: xs, a, b, ...)`` which however

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-25 Thread Florian Mayer
Changes by Florian Mayer florma...@aim.com: -- nosy: +segfaulthunter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7203 ___ ___ Python-bugs-list

[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-25 Thread Florian Mayer
Florian Mayer florma...@aim.com added the comment: A full fix would be list(map(fun, *zip(*itertools.zip_longest(a, b, ... and if fun is None list(map(lambda *xs: xs, *zip(*itertools.zip_longest(a, b, ... -- ___ Python tracker rep

Pool module -- does map pre-assign tasks to processes?

2009-09-28 Thread Luca
], a [16], process 1 with elements a[1], a[9], a[17], and so forth. Rather, I would like all tasks to be put into a queue, and I would like the processes to each time grab the next task to be done, and do it. This would ensure fairly equal loading. My question is: does the map() method of Pool pre

Re: map

2009-09-02 Thread elsa
on. Don't know if this rant makes any sense... - Hendrik in my own defense - firstly, I was able to implement what I wanted to do with loops, and I used this to solve the problem I needed to. However, by asking *why* map didn't work, I now understand how map works, what contexts it may indeed

Re: map

2009-09-02 Thread Hendrik van Rooyen
such clear questions as you did, it would be an even greater pleasure to participate in than it is. However, by asking *why* map didn't work, I now understand how map works, what contexts it may indeed be useful for, and what the alternatives are. To boot, you have all given me about 10

Re: map

2009-09-01 Thread alex23
Piet van Oostrum p...@cs.uu.nl wrote: [myFunc(elt, 'booHoo') for elt in myList] is also a good candidate and in this case I think it is preferable to both the loop and the map with a partial or lambda in terms of clarity. From memory, a listcomp with a non-builtin function is also faster than

Re: map

2009-09-01 Thread Jan Kaliszewski
Another possibilities, if you really *desire* to use map() and not list-comprehension (I'd prefer the latter), are: # Python 2.x: map(func, mylist, itertools.repeat('booHoo', len(mylist))) # Python 3.x, where map() works like Py2.x's itertools.imap(): list(map(func, mylist, itertools.repeat

Re: map

2009-08-31 Thread Hendrik van Rooyen
On Monday 31 August 2009 06:55:52 elsa wrote: 8 - map question (Ultimately, I want to call myFunc(myList[0], 'booHoo'), myFunc(myList [1], 'booHoo'), myFunc(myList[2], 'booHoo') etc. However, I might want to call myFunc(myList[0], 'woo'), myFunc(myList[1

Re: map

2009-08-31 Thread Gabriel Genellina
(myList[0], 'woo'), myFunc(myList[1], 'woo'), myFunc (myList[2], 'woo') some other time). Here is some heretical advice: Do not use stuff like map and reduce unless they fit what you want to do perfectly, and JustWorks the first time. I think of that advice as orthodox, not heretical! (functional

Re: map

2009-08-31 Thread Piet van Oostrum
Hendrik van Rooyen hend...@microcorp.co.za (HvR) wrote: HvR On Monday 31 August 2009 06:55:52 elsa wrote: HvR 8 - map question (Ultimately, I want to call myFunc(myList[0], 'booHoo'), myFunc(myList [1], 'booHoo'), myFunc(myList[2], 'booHoo') etc. However

Re: map

2009-08-31 Thread Steven D'Aprano
On Mon, 31 Aug 2009 10:43:07 +0200, Hendrik van Rooyen wrote: Here is some heretical advice: Do not use stuff like map and reduce unless they fit what you want to do perfectly, and JustWorks the first time. You have a very clear idea of what you want to do, so why do you not just simply

Re: map

2009-08-31 Thread Hendrik van Rooyen
On Monday 31 August 2009 11:31:34 Piet van Oostrum wrote: But ultimately it is also very much a matter of taste, preference and habit. This is true, but there is another reason that I posted - I have noticed that there seems to be a tendency amongst newcomers to the group to go to great

Re: map

2009-08-31 Thread Paul Rubin
elsa kerensael...@hotmail.com writes: map(myFunc(b='booHoo'), myList) Why doesn't this work? is there a way to make it work? You can use functools.partial but a listcomp might be simpler: list(myfunc(a, b='booHoo') for a in myList) There is another listcomp syntax with square brackets

Re: map

2009-08-31 Thread Nobody
On Sun, 30 Aug 2009 21:55:52 -0700, elsa wrote: say I have a list, myList. Now say I have a function with more than one argument: myFunc(a, b='None') now, say I want to map myFunc onto myList, with always the same argument for b, but iterating over a: map(myFunc(b='booHoo'), myList

map

2009-08-30 Thread elsa
Hi, i have a question about the built in map function. Here 'tis: say I have a list, myList. Now say I have a function with more than one argument: myFunc(a, b='None') now, say I want to map myFunc onto myList, with always the same argument for b, but iterating over a: map(myFunc(b='booHoo

Re: map

2009-08-30 Thread Chris Rebert
On Sun, Aug 30, 2009 at 9:55 PM, elsakerensael...@hotmail.com wrote: Hi, i have a question about the built in map function. Here 'tis: say I have a list, myList. Now say I have a function with more than one argument: myFunc(a, b='None') now, say I want to map myFunc onto myList

Re: map

2009-08-30 Thread rurpy
On 08/30/2009 10:55 PM, elsa wrote: i have a question about the built in map function. Here 'tis: say I have a list, myList. Now say I have a function with more than one argument: myFunc(a, b='None') now, say I want to map myFunc onto myList, with always the same argument for b

Re: map

2009-08-30 Thread Wolfgang Strobl
elsa kerensael...@hotmail.com: now, say I want to map myFunc onto myList, with always the same argument for b, but iterating over a: from functools import partial def g(x,y=1): return x+y ... map(partial(g,y=2),[1,2]) [3, 4] map(partial(g,y=42),[1,2]) [43, 44] -- Wir danken für die

Shortest path code on real map

2009-08-01 Thread Joongkoo Cho
Dear All, I'm trying to calculate shortest paths on US highway map. I understand how shortest path algorithms work in Python but I need helps to do it on real maps. How can I make link-node information? Best, John -- http://mail.python.org/mailman/listinfo/python-list

[issue1616979] cp720 encoding map

2009-07-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The codec file now starts with the comment: Python Character Mapping Codec cp720 generated on Windows: Vista 6.0.6002 SP2 Multiprocessor Free with the command: python Tools/unicode/genwincodec.py 720 I also added a file

[issue1616979] cp720 encoding map

2009-07-12 Thread Abdulmonem
Abdulmonem dubais...@gmail.com added the comment: As a user I experienced this bug. With python 3.1, the interpreter terminate with fatal error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: cp720 I think, this can be replicated by changing the active

[issue1616979] cp720 encoding map

2009-07-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Instead of using another source of third-party files, I suggest to use the Windows functions to generate the mapping. The attached patch contains a script, genwincodec.py, which uses MultiByteToWideChar and generates a codec file. I

[issue1616979] cp720 encoding map

2009-07-12 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file14490/genwincodec-py3k.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1616979

[issue1616979] cp720 encoding map

2009-07-12 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Amaury: your approach sounds fine to me, please apply. -- resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1616979

[issue1616979] cp720 encoding map

2009-07-12 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Reconsidering, I'd like to ask for two changes: - please record the command(s) used to generate tables on Windows somewhere, in either Tools/unicode/Makefile, or a separate batch file. - please arrange for the doc string of the generated file

Re: How to map size_t using ctypes?

2009-07-07 Thread Philip Semanchuk
On Jul 6, 2009, at 11:51 PM, Gabriel Genellina wrote: En Mon, 06 Jul 2009 13:29:21 -0300, Philip Semanchuk phi...@semanchuk.com escribió: On Jul 6, 2009, at 12:10 PM, Diez B. Roggisch wrote: Philip Semanchuk wrote: I can't figure out how to map a C variable of size_t via Python's ctypes

How to map size_t using ctypes?

2009-07-06 Thread Philip Semanchuk
Hi all, I can't figure out how to map a C variable of size_t via Python's ctypes module. Let's say I have a C function like this: void populate_big_array(double *the_array, size_t element_count) {...} How would I pass parameter 2? A long (or ulong) will (probably) work (on most platforms

Re: How to map size_t using ctypes?

2009-07-06 Thread Diez B. Roggisch
Philip Semanchuk wrote: Hi all, I can't figure out how to map a C variable of size_t via Python's ctypes module. Let's say I have a C function like this: void populate_big_array(double *the_array, size_t element_count) {...} How would I pass parameter 2? A long (or ulong) will (probably

Re: How to map size_t using ctypes?

2009-07-06 Thread Philip Semanchuk
On Jul 6, 2009, at 12:10 PM, Diez B. Roggisch wrote: Philip Semanchuk wrote: Hi all, I can't figure out how to map a C variable of size_t via Python's ctypes module. Let's say I have a C function like this: void populate_big_array(double *the_array, size_t element_count) {...} How would

Re: How to map size_t using ctypes?

2009-07-06 Thread Gabriel Genellina
En Mon, 06 Jul 2009 13:29:21 -0300, Philip Semanchuk phi...@semanchuk.com escribió: On Jul 6, 2009, at 12:10 PM, Diez B. Roggisch wrote: Philip Semanchuk wrote: I can't figure out how to map a C variable of size_t via Python's ctypes module. from ctypes import c_size_t D'oh! [slaps

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Unpickling e.g. StringIO objects doesn't seem to work: s = pickle.load(open(stringio.pickle, rb)) Traceback (most recent call last): File stdin, line 1, in module File /home/antoine/py3k/picklecompat-6137/Lib/pickle.py, line 1351, in load

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: An improved patch with tests. It has no tests for fix_imports=False, though. -- Added file: http://bugs.python.org/file14175/compat_pickle2.diff ___ Python tracker rep...@bugs.python.org

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: A new patch which also includes reverse mappings, so that protocol = 2 pickles created with 3.x can also work under 2.x. (that is, it also solves #3675) -- dependencies: +Python 2.6 can't read sets pickled with Python 3.0 Added file:

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch with a couple of documentation and function prototype fixes. -- dependencies: -Python 2.6 can't read sets pickled with Python 3.0 Added file: http://bugs.python.org/file14178/compat_pickle4.diff

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Sorry, last patch had a couple of minor issues -- Added file: http://bugs.python.org/file14179/compat_pickle5.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file14177/compat_pickle3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file14178/compat_pickle4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-01 Thread Matthias Kievernagel
Matthias Kievernagel mkie...@web.de added the comment: Applied the patch http://bugs.python.org/file14124/compat_pickle.diff to rev. 73106. Patch applies fine, 'make test' passes and it solves my problem. (which is far from a complete test case though - only 5 small pickles) Thanks, Matthias

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Some comments on the patch: - I don't understand why you create a static twotuple object rather than simply using Py_BuildValue((OO), ...). Mutating tuples is bad. - I don't think you need to call PyDict_Contains() before PyDict_GetItem(). The

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-01 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- components: +Library (Lib) -None priority: - critical type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: If I understood correctly, #3675 is about making pickle data generated by Python 3 readable by Python 2. Only if a protocol = 2 is specified. Therefore it seems it's only a matter of translating module names. --

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-30 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: If I understood correctly, #3675 is about making pickle data generated by Python 3 readable by Python 2. However, this issue is about compatibility in the other direction—i.e., making Python 2 pickles readable by Python 3, which is

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-28 Thread Matthias Kievernagel
://bugs.python.org/issue3799#msg76196 Could not find an issue opened for this though. So I'm opening one. Regards, Matthias Kievernagel -- components: None messages: 88470 nosy: mkiever severity: normal status: open title: Pickle migration: Should pickle map copy_reg to copyreg? versions: Python

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: #3675 is a similar issue, too bad nothing could be done to solve it... -- nosy: +alexandre.vassalotti, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137

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

2009-05-12 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- stage: - patch review type: - feature request versions: +Python 2.7, Python 3.1 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1513299

[issue1616979] cp720 encoding map

2009-03-30 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- components: +Unicode -None stage: - test needed type: - feature request versions: +Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1616979

Re: Iterating over readlines() and map()

2009-03-25 Thread W. Martin Borgert
(Resend, because of funny error message: Your mail to 'Python-list' with the subject Iterating over readlines() and map() Is being held until the list moderator can review it for approval. Whatever this means.) Hi, if I understand correctly, this code would not read the complete file

Re: Iterating over readlines() and map()

2009-03-25 Thread Christian Heimes
W. Martin Borgert schrieb: (Resend, because of funny error message: Your mail to 'Python-list' with the subject Iterating over readlines() and map() Is being held until the list moderator can review it for approval. Whatever this means.) Hi, if I understand correctly, this code

Re: Iterating over readlines() and map()

2009-03-25 Thread W. Martin Borgert
On 2009-03-26 01:41, Christian Heimes wrote: No, you are wrong. file.readlines() reads the entire file into memory and returns a list of strings. If you want to iterate over the lines of a text file you can simply write: for line in myfile: dosomethingwith(line) It won't work for a

Iterating over readlines() and map()

2009-03-25 Thread W. Martin Borgert
Hi, if I understand correctly, this code would not read the complete file into the memory: for line in myfile.readlines(): dosomethingwith(line) Is this also true for this code? for line in map(myfunction, myfile.readlines()): dosomethingwith(line) Or would use of map() mean

Re: Iterating over readlines() and map()

2009-03-25 Thread alex23
On Mar 26, 10:27 am, W. Martin Borgert deba...@debian.org wrote: Is this also true for this code? for line in map(myfunction, myfile.readlines()):     dosomethingwith(line) Or would use of map() mean, that the complete myfile is read into the RAM? As Christian explained, you're really

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