DEAP release 1.0.0: Distributed Evolutionary Algorithms in Python

2014-02-21 Thread Félix-Antoine Fortin
After more than 4 years of development, we are proud to announce the release of DEAP 1.0.0. You can download a copy of this release at the following web page. https://pypi.python.org/pypi/deap DEAP (Distributed Evolutionary Algorithms in Python) is a novel evolutionary computation framework

Yet Another SWF Parser

2014-02-21 Thread Facundo Batista
I'm very proud to present Yet Another SWF Parser: yaswfp, you can pronounce whatever you like :) https://github.com/facundobatista/yaswfp You can use it as command line program or as a module, for example (slightly truncated for readability): swf = swfparser.parsefile(yourSWFfile)

New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread ApathyBear
I don't understand how APIs work to save my life. I am a complete beginner. In fact, I am a bit confused on what API even means and what the meaning entails. I am fairly competent with python, though I do lack some real world experience. Regardless, any tutorials/books/guides that deal with API

Re: The sum of numbers in a line from a file

2014-02-21 Thread Johannes Schneider
s = 4 e = 7 with f = file('path_to_file) as fp: for line in f: if line.startswith(name): avg = sum(map(int, filter(ambda x : len(x) 0, s.split(' '))[s : e])) / (e - s) On 20.02.2014 17:22, kxjakkk wrote:

Re: Commonly-used names in the Python standard library

2014-02-21 Thread Chris Angelico
On Fri, Feb 21, 2014 at 6:21 PM, Marko Rauhamaa ma...@pacujo.net wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: On Thu, 20 Feb 2014 12:22:29 +0200, Marko Rauhamaa wrote: I'm looking forward to the day when every application can add its own keywords as is customary in Lisp. And

Re: Remove comma from tuples in python.

2014-02-21 Thread Gary Herron
On 02/20/2014 10:49 PM, Jaydeep Patil wrote: I am getting below tuple from excel. How should i remove extra commas in each tuple to make it easy for operations. tuples is: seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07), (0.08), (0.09), (0.1), (0.11)) please

Re: Can global variable be passed into Python function?

2014-02-21 Thread Gary Herron
On 02/20/2014 10:37 PM, Sam wrote: I need to pass a global variable into a python function. However, the global variable does not seem to be assigned after the function ends. Is it because parameters are not passed by reference? How can I get function parameters to be passed by reference in

Re: Can global variable be passed into Python function?

2014-02-21 Thread Steven D'Aprano
On Thu, 20 Feb 2014 22:37:59 -0800, Sam wrote: I need to pass a global variable into a python function. However, the global variable does not seem to be assigned after the function ends. Is it because parameters are not passed by reference? How can I get function parameters to be passed by

Re: Can global variable be passed into Python function?

2014-02-21 Thread Jussi Piitulainen
dieter writes: Sam writes: I need to pass a global variable into a python function. Python does not really have the concept variable. What appears to be a variable is in fact only the binding of an object to a name. If you assign something to a variable, all you do is binding a

Re: Remove comma from tuples in python.

2014-02-21 Thread Jussi Piitulainen
Gary Herron writes: On 02/20/2014 10:49 PM, Jaydeep Patil wrote: I am getting below tuple from excel. How should i remove extra commas in each tuple to make it easy for operations. tuples is: seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07), (0.08),

Re: Commonly-used names in the Python standard library

2014-02-21 Thread Steven D'Aprano
On Fri, 21 Feb 2014 09:21:56 +0200, Marko Rauhamaa wrote: I don't hear Lispers or C programmers complaining. Lisp is not a popular language. Despite being more powerful, more efficient, and a lot older, I expect that there are far fewer people who know Lisp (let alone use it regularly) than

NEW GROUND BREAKING STUDIES IN CREATIONIST BULLSHIT:

2014-02-21 Thread THRINAXODON'S CREATIONIST STUDIES
http://www.evolutionnews.org/2014/02/at_first_things_1082371.html , NOW FOR YOUR FAVORITE TIME SLOT: HUMANS HAVE ORIGINS IN THE DEVONIAN: https://groups.google.com/forum/#!topic/alt.atheism.holysmoke/etpGIbTPXz8 -- Thrinaxodon, the ultimate defender of USENET. --

Re: New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread Steven D'Aprano
On Thu, 20 Feb 2014 23:59:16 -0800, ApathyBear wrote: I don't understand how APIs work to save my life. I am a complete beginner. In fact, I am a bit confused on what API even means and what the meaning entails. API stands for Application Programming Interface, and it essentially means the

Re: Remove comma from tuples in python.

2014-02-21 Thread Alister
On Fri, 21 Feb 2014 11:13:30 +0200, Jussi Piitulainen wrote: Gary Herron writes: On 02/20/2014 10:49 PM, Jaydeep Patil wrote: I am getting below tuple from excel. How should i remove extra commas in each tuple to make it easy for operations. tuples is: seriesxlist1 = ((0.0),

Re: Can global variable be passed into Python function?

2014-02-21 Thread Marko Rauhamaa
Jussi Piitulainen jpiit...@ling.helsinki.fi: In alleged contrast, the observable behaviour of languages that have variables is the same. This is not considered confusing by the people who insist that there are no variables in Python. But of course there are variables in Python: By

Re: Commonly-used names in the Python standard library

2014-02-21 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: How does C let you create new keywords? With #define. Nowhere near as elegant (flexible, hygienic) as in Lisp, but used to create new syntax: include/linux/list.h: #define list_for_each(pos, head) \ for (pos = (head)-next; pos != (head); pos =

Re: Commonly-used names in the Python standard library

2014-02-21 Thread Chris Angelico
On Fri, Feb 21, 2014 at 9:26 PM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: How does C let you create new keywords? With #define. Nowhere near as elegant (flexible, hygienic) as in Lisp, but used to create new syntax: That can't create new syntax, though. All it

Re:TypeError: can't multiply sequence by non-int of type 'tuple'

2014-02-21 Thread Dave Angel
Jaydeep Patil patil.jay2...@gmail.com Wrote in message: HI, I have a tuple. I need to make sqaure of elements of tuple and after that i want add all suared tuple elements for total. When i trying to do it, below error came. Code: seriesxlist1 = ((0.0,), (0.01,), (0.02,), (0.03,),

NEWS FLASH: ATHEISTS DOWN AND BLEEDING AFTER THEIR FAVORITE PET THEORY GOES DOWN THE DRAIN.

2014-02-21 Thread THRINAXODON TIMES
== BREAKING NEWS == THRINAXODON JUST BEAT RICHARD LEAKEY 100-0 IN WORLD SCIENCE CHAMPIONSHIP. LEAKEY WAS TRYING WITH ALL HIS MIGHT TO PROVE HUMAN'S QUATERNARY ORIGINS, BUT THRINAXODON DEFEATED HIM WITH A FEW HUMAN DEVONIAN FOSSILS. THE FOSSILS WERE EXACT,

Re:New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread Dave Angel
ApathyBear nircher...@gmail.com Wrote in message: I don't understand how APIs work to save my life. I am a complete beginner. In fact, I am a bit confused on what API even means and what the meaning entails. I am fairly competent with python, though I do lack some real world experience.

Re: Commonly-used names in the Python standard library

2014-02-21 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: On Fri, Feb 21, 2014 at 9:26 PM, Marko Rauhamaa ma...@pacujo.net wrote: With #define. Nowhere near as elegant (flexible, hygienic) as in Lisp, but used to create new syntax: That can't create new syntax, though. All it can do is create a thing that looks

Re: Can global variable be passed into Python function?

2014-02-21 Thread Ned Batchelder
On 2/21/14 2:23 AM, dieter wrote: Samlightai...@gmail.com writes: I need to pass a global variable into a python function. Python does not really have the concept variable. What appears to be a variable is in fact only the binding of an object to a name. If you assign something to a

Re: Can global variable be passed into Python function?

2014-02-21 Thread Marko Rauhamaa
Ned Batchelder n...@nedbatchelder.com: Man, do I hate this idea that Python has no variables. It has variables (names associated with values, and the values can change over the course of the program), In classic functional programming, the values of variables can't change but they are still

Re: Remove comma from tuples in python.

2014-02-21 Thread Tim Chase
On 2014-02-21 09:29, Alister wrote: seriesxlist1 = ((0.0,), (0.01,), (0.02,)) x2 = [x*x for (x,) in seriesxlist1] I tend to omit those parentheses and use just the comma: x2 = [x*x for x, in seriesxlist1] I had not though of using unpacking in this way would

Re: Remove comma from tuples in python.

2014-02-21 Thread Mark Lawrence
On 21/02/2014 08:27, Gary Herron wrote: A bit of notation, because I''m not sure we are communicating well here: A tuple is a Python data structure. It has no commas or parentheses. The *printing* of a Python tuple uses both for it's appearance on the output, but the tuple itself has no

Re: Remove comma from tuples in python.

2014-02-21 Thread Peter Otten
Tim Chase wrote: With the single-value tuple, I tend to find the parens make it more readable, so I'd go with [x*x for (x,) in lst] Hardly ever seen in the wild, but unpacking works with [...], too: items = zip(range(5)) [x*x for [x] in items] [0, 1, 4, 9, 16] --

Re: Cross-platform way to get default directory for binary files like console scripts?

2014-02-21 Thread Piotr Dobrogost
On Thursday, February 20, 2014 4:34:25 PM UTC+1, Piotr Dobrogost wrote: I'm wondering if there's some API to get this info as what you showed is really roundabout way to achieve the goal... Turns out there is API for this - see thread on distutils-sig mailing list at

Re: Remove comma from tuples in python.

2014-02-21 Thread Roy Smith
In article mailman.7230.1392992078.18130.python-l...@python.org, Peter Otten __pete...@web.de wrote: [x*x for (x,) in lst] [paraphrasing...] can be better written as: [x*x for [x] in items] I'm torn between, Yes, the second form is distinctly easier to read and, If you think the second

Re: Remove comma from tuples in python.

2014-02-21 Thread Travis Griggs
On Feb 21, 2014, at 6:32 AM, Roy Smith r...@panix.com wrote: In article mailman.7230.1392992078.18130.python-l...@python.org, Peter Otten __pete...@web.de wrote: [x*x for (x,) in lst] [paraphrasing...] can be better written as: [x*x for [x] in items] I'm torn between, Yes, the

Re: Can global variable be passed into Python function?

2014-02-21 Thread Travis Griggs
On Feb 21, 2014, at 4:13 AM, Ned Batchelder n...@nedbatchelder.com wrote: Man, do I hate this idea that Python has no variables. It has variables (names associated with values, and the values can change over the course of the program), they just don't work the same as C or Fortran

Re: Remove comma from tuples in python.

2014-02-21 Thread Tim Chase
On 2014-02-21 09:48, Travis Griggs wrote: I’ve used the comma form with struct.unpack() frequently: count, = struct.unpack(‘!I’, self.packet) This is *especially* one of those places I want extra parens to make sure I see what's happening. I've been stung too many times by the easy-to-miss

Re: Can global variable be passed into Python function?

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 4:59 AM, Travis Griggs travisgri...@gmail.com wrote: What makes Python variables/bindings/references/aliases/namedvalues/slots/bucketsofstuff surprising to new arrivals from other language kingdoms, is that accessing is pragmatically implicit (walks the scope tree

Re: Just For Inquiry

2014-02-21 Thread Denis McMahon
On Thu, 20 Feb 2014 20:58:52 +0530, shivang patel wrote: So, I kindly request to you please, give me a very brief info regarding *Role of Project Manager*. while not project_is_finished(): take_steps_to_advance_project() -- Denis McMahon, denismfmcma...@gmail.com --

property confusion

2014-02-21 Thread K Richard Pixley
Could someone please explain to me why the two values at the bottom of this example are different? Python-3.3 if it makes any difference. Is this a difference in evaluation between a class attribute and an instance attribute? --rich class C: def __init__(self): self._x = None

Re: Can global variable be passed into Python function?

2014-02-21 Thread Marko Rauhamaa
On the question of how variables can be passed to functions, C, of course, has the operator and Pascal has the var keyword. An analogous thing can be achieved in Python 3 (but not in Python 2, I'm afraid). The operator corresponds to an ad hoc property class as in the program below (not

Re: property confusion

2014-02-21 Thread Rotwang
On 21/02/2014 18:58, K Richard Pixley wrote: Could someone please explain to me why the two values at the bottom of this example are different? Python-3.3 if it makes any difference. Is this a difference in evaluation between a class attribute and an instance attribute? Yes, see below.

Re: Commonly-used names in the Python standard library

2014-02-21 Thread Ethan Furman
On 02/21/2014 04:03 AM, Marko Rauhamaa wrote: With the addition of macros, Python would become a (remote) Lisp dialect. Defining macros would become more complicated because of Python's more complex supersyntax. Have you tried MacroPy? If not, you should. If so, what were its failings? --

Re: New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread ApathyBear
Thanks, I think I have an understanding of what they are, but now am still a little confused on how one goes about using it: how am I supposed to know how to use an API in python? or in any other language for that matter? If an API is defining rules in C, is all hope lost for trying to use it

Re: New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread Joel Goldstick
On Feb 21, 2014 3:15 PM, ApathyBear nircher...@gmail.com wrote: Thanks, I think I have an understanding of what they are, but now am still a little confused on how one goes about using it: how am I supposed to know how to use an API in python? or in any other language for that matter? If an API

Re: Commonly-used names in the Python standard library

2014-02-21 Thread 88888 Dihedral
On Friday, February 21, 2014 12:26:00 AM UTC+8, Marko Rauhamaa wrote: Chris Angelico ros...@gmail.com: Also, what happens if two modules (one of which might be your script) written for different versions both import some third module? Should they get different versions, based on

Storing the state of script between steps

2014-02-21 Thread Denis Usanov
Good evening. First of all I would like to apologize for the name of topic. I really didn't know how to name it more correctly. I mostly develop on Python some automation scripts such as deployment (it's not about fabric and may be not ssh at all), testing something, etc. In this terms I have

new life at comp.misc

2014-02-21 Thread RS Wood
If you weren't already aware, a bunch of people who usually read slashdot.org got frustrated and went back to Usenet, partly because of the new slashdot beta interface Dice Media is imposing, partly because we all suddenly remembered how much we love Usenet. We all landed at comp.misc. If you

solutions manual and test banks

2014-02-21 Thread ineedsolutionsbook
ineedsolutionsbook(at)hotmail.com i n e e d s o l u t i o n s b o o k @ h o t m a i l . c o m We're a team found for providing solution manuals to help students in their study. We sell the books in a soft copy, PDF format. We will do our best to find any book or solution manual for you.

Re: Win32 Write RAW Physical Disk Python 3.3.2

2014-02-21 Thread khanta
Can anyone tell me if it is not possible? It would save me a lot of time. Has anyone ever written to the raw disk on windows? On Wednesday, February 19, 2014 7:42:02 AM UTC-5, khanta wrote: Hello, I am trying to write to the raw physical disk on Windows 8.1 but I get an error:

Re: inheriting a large python code base

2014-02-21 Thread craig
Look at the algorithms and see if there are faster ways. Great advice with the comments of writing test cases, getting into version control, taking passes through the code with tools, understanding what is slow and why it is considered slow. Then you should invest the time to understand the

Re: Win32 Write RAW Physical Disk Python 3.3.2

2014-02-21 Thread Mark Lawrence
On 21/02/2014 21:32, kha...@gmail.com wrote: Can anyone tell me if it is not possible? It would save me a lot of time. Has anyone ever written to the raw disk on windows? Sorry I can't help you, but you're more likely to get answers if you didn't top post and you use a decent email client

Re: Win32 Write RAW Physical Disk Python 3.3.2

2014-02-21 Thread Jerry Hill
On Wed, Feb 19, 2014 at 7:42 AM, khanta kha...@gmail.com wrote: Hello, I am trying to write to the raw physical disk on Windows 8.1 but I get an error: PermissionError: [Errno 13] Permission denied: '.\\PHYSICALDRIVE2' Is there a volume mounted from the drive at the time you're

Re: Error getting REMOTE_USER Environment Variable

2014-02-21 Thread Hobie Audet
How many other environment variables are doubled? All of them? The only other environment variable I have tried is REMOTE_ADDR, and that does not appear to be doubled. Does the problem exist when the Python script is run directly, outside Abyss, or in IDLE, for example? The problem is

Re: Error getting REMOTE_USER Environment Variable

2014-02-21 Thread MRAB
On 2014-02-21 22:48, Hobie Audet wrote: How many other environment variables are doubled? All of them? The only other environment variable I have tried is REMOTE_ADDR, and that does not appear to be doubled. Does the problem exist when the Python script is run directly, outside Abyss, or

is there a package similar to SHINY in R for python ...

2014-02-21 Thread anujg1984
I want to have textboxes, sliders, and buttons in the web browser that change the data visualization just like shiny does in R. Is there something like that in python. Bokeh makes graphs in the browser, but they dont provide a way to manipulate the graph with sliders, textboxes etc. ? --

Re: Storing the state of script between steps

2014-02-21 Thread Cameron Simpson
On 21Feb2014 12:59, Denis Usanov usano...@gmail.com wrote: I mostly develop on Python some automation scripts such as deployment (it's not about fabric and may be not ssh at all), testing something, etc. In this terms I have such abstraction as step. Some code: class IStep(object):

Python and variables (was: Can global variable be passed into Python function?)

2014-02-21 Thread Ben Finney
Ned Batchelder n...@nedbatchelder.com writes: On 2/21/14 2:23 AM, dieter wrote: Samlightai...@gmail.com writes: I need to pass a global variable into a python function. Python does not really have the concept variable. What appears to be a variable is in fact only the binding of an

Re: Function and turtle help

2014-02-21 Thread Scott W Dunning
On Feb 20, 2014, at 11:30 PM, Dave Angel da...@davea.name wrote: Look at turtle.begin_fill and turtle.end_fill That's after making sure your star is a closed shape. So, this is what I have so far and it “works” but, it fills in the star with black and as you can see below I am trying to

Re: New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread Roy Smith
In article 3fa5e368-a47c-4a7e-80dc-c5333fb56...@googlegroups.com, ApathyBear nircher...@gmail.com wrote: Thanks, I think I have an understanding of what they are, but now am still a little confused on how one goes about using it: how am I supposed to know how to use an API in python? or in

Re: Function and turtle help

2014-02-21 Thread Dave Angel
Scott W Dunning swdunn...@cox.net Wrote in message: On Feb 20, 2014, at 11:30 PM, Dave Angel da...@davea.name wrote: Look at turtle.begin_fill and turtle.end_fill That's after making sure your star is a closed shape. So, this is what I have so far and it “works” but, it fills

Re: New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread Steven D'Aprano
On Fri, 21 Feb 2014 12:12:00 -0800, ApathyBear wrote: Thanks, I think I have an understanding of what they are, but now am still a little confused on how one goes about using it: how am I supposed to know how to use an API in python? *scratches head* Er, first you learn how to program in

Re: is there a package similar to SHINY in R for python ...

2014-02-21 Thread Michael Torrie
On 02/21/2014 07:57 PM, Dennis Lee Bieber wrote: On Fri, 21 Feb 2014 15:28:55 -0800 (PST), anujg1...@gmail.com declaimed the following: I want to have textboxes, sliders, and buttons in the web browser that change the data visualization just like shiny does in R. Is there something like

Re: Can global variable be passed into Python function?

2014-02-21 Thread Ned Batchelder
On 2/21/14 9:47 PM, Dennis Lee Bieber wrote: On Fri, 21 Feb 2014 09:59:17 -0800, Travis Griggs travisgri...@gmail.com declaimed the following: On Feb 21, 2014, at 4:13 AM, Ned Batchelder n...@nedbatchelder.com wrote: Man, do I hate this idea that Python has no variables. It has variables

Re: IDLE won't run after installing Python 3.3 in Windows

2014-02-21 Thread Mark H. Harris
On Tuesday, February 18, 2014 8:56:51 AM UTC-6, eglows...@gmail.com wrote: Any suggestions? Thanks in advance! Is there any possibility that you are bumping up against open IDLE Issue 14576? http://bugs.python.org/issue14576 -- https://mail.python.org/mailman/listinfo/python-list

Re: Can global variable be passed into Python function?

2014-02-21 Thread Steven D'Aprano
On Fri, 21 Feb 2014 07:13:25 -0500, Ned Batchelder wrote: On 2/21/14 2:23 AM, dieter wrote: Samlightai...@gmail.com writes: I need to pass a global variable into a python function. Python does not really have the concept variable. What appears to be a variable is in fact only the binding

Re: Storing the state of script between steps

2014-02-21 Thread Steven D'Aprano
On Fri, 21 Feb 2014 12:59:11 -0800, Denis Usanov wrote: I mostly develop on Python some automation scripts such as deployment (it's not about fabric and may be not ssh at all), testing something, etc. In this terms I have such abstraction as step. Some code: class IStep(object): def

Re: Can global variable be passed into Python function?

2014-02-21 Thread Ned Batchelder
On 2/21/14 10:28 PM, Steven D'Aprano wrote: On Fri, 21 Feb 2014 07:13:25 -0500, Ned Batchelder wrote: On 2/21/14 2:23 AM, dieter wrote: Samlightai...@gmail.com writes: I need to pass a global variable into a python function. Python does not really have the concept variable. What appears

Re: New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread Cameron Simpson
On 22Feb2014 02:45, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 21 Feb 2014 12:12:00 -0800, ApathyBear wrote: [...] or in any other language for that matter? If an API is defining rules in C, is all hope lost for trying to use it in python? If an API is defined

Re: Function and turtle help

2014-02-21 Thread Scott W Dunning
On Feb 21, 2014, at 7:13 PM, Dave Angel da...@davea.name wrote: Scott W Dunning swdunn...@cox.net Wrote in message: On Feb 20, 2014, at 11:30 PM, Dave Angel da...@davea.name wrote: Look at turtle.begin_fill and turtle.end_fill That's after making sure your star is a closed shape.

Re: Function and turtle help

2014-02-21 Thread Dave Angel
On 02/21/2014 10:38 PM, Scott W Dunning wrote: On Feb 21, 2014, at 7:13 PM, Dave Angel da...@davea.name wrote: Scott W Dunning swdunn...@cox.net Wrote in message: On Feb 20, 2014, at 11:30 PM, Dave Angel da...@davea.name wrote: Look at turtle.begin_fill and turtle.end_fill That's after

Re: Can global variable be passed into Python function?

2014-02-21 Thread Steven D'Aprano
On Fri, 21 Feb 2014 22:45:14 -0500, Ned Batchelder wrote: I think it might be that the OP's question, Can a global variable be passed into a function, really had nothing to do with the name/value/variable distinction, and we've done it again: taken a simple question and spun off into pedantry

Re: Can global variable be passed into Python function?

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 6:20 AM, Marko Rauhamaa ma...@pacujo.net wrote: On the question of how variables can be passed to functions, C, of course, has the operator and Pascal has the var keyword. That doesn't pass a variable into a function, though. It passes the address of that variable, and

Re: Can global variable be passed into Python function?

2014-02-21 Thread Steven D'Aprano
On Fri, 21 Feb 2014 21:20:12 +0200, Marko Rauhamaa wrote: On the question of how variables can be passed to functions, C, of course, has the operator and Pascal has the var keyword. An analogous thing can be achieved in Python 3 (but not in Python 2, I'm afraid). The operator corresponds

Re: Can global variable be passed into Python function?

2014-02-21 Thread Steven D'Aprano
On Sat, 22 Feb 2014 17:36:52 +1100, Chris Angelico wrote: On Sat, Feb 22, 2014 at 6:20 AM, Marko Rauhamaa ma...@pacujo.net wrote: On the question of how variables can be passed to functions, C, of course, has the operator and Pascal has the var keyword. That doesn't pass a variable into a

Re: Can global variable be passed into Python function?

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 6:18 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Now I daresay that under the hood, Pascal is passing the address of foo (or bar) to the procedure plus, but inside plus you don't see that address as the value of b. You see the value of foo (or bar).

Re: Can global variable be passed into Python function?

2014-02-21 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: But your code doesn't succeed at doing what it sets out to do. If you try to call it like this: py x = 23 py y = 42 py swap(x, y) Traceback (most recent call last): File stdin, line 1, in module File stdin, line 2, in swap

[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-21 Thread Larry Hastings
Larry Hastings added the comment: I just put the third preview up. There are no diffs between that asyncio and the one in default. Is this torrent coming to a close? We really should keep the changes from rc2 to final to a bare minimum. -- ___

[issue20714] Allow for ]] in CDATA in minidom

2014-02-21 Thread Éric Araujo
Éric Araujo added the comment: Does the XML spec allow that? -- nosy: +eric.araujo title: Please allow for ]] in CDATA in minidom.py - Allow for ]] in CDATA in minidom versions: +Python 3.5 -Python 2.7, Python 3.3 ___ Python tracker

[issue20648] 3.4 cherry-pick: multiple changesets for asyncio

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: Is this torrent coming to a close? We really should keep the changes from rc2 to final to a bare minimum. I agree. We may improve the documentation, but such commits doesn't need to be cherry-picked. Many people read the documentation online

[issue19748] test_time failures on AIX

2014-02-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 502c8b7e8ad2 by Victor Stinner in branch 'default': Issue #19748: On AIX, time.mktime() now raises an OverflowError for year http://hg.python.org/cpython/rev/502c8b7e8ad2 -- nosy: +python-dev ___ Python

[issue19748] test_time failures on AIX

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: With the latest patch, test_time passes. Ok, thanks for your tests. But time.ctime() is still wrong. Can you please try the following examples with the latest Python version (502c8b7e8ad2) and then retry with pylocaltime_aix.patch? time.ctime(-2**29) 'Sat

[issue10510] distutils upload/register should use CRLF in HTTP requests

2014-02-21 Thread Matthew Iversen
Matthew Iversen added the comment: Sorry, I referenced http://bugs.python.org/issue12169 before. distutils multipart/form-data encoding still breaks the spec for MIME, which demands CRLF line endings. Especially since it is now sending HTTP 1.1 requests which should conform. The patch /

[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: I copy the nosy list from issue #6560 which added the recvmsg() and sendmsg() methods. -- nosy: +baikie, brett.cannon, brian, exarkun, giampaolo.rodola, jackdied, janssen, jcea, ncoghlan, neologix, pitrou, python-dev, rosslagerwall, schmichael,

[issue10510] distutils upload/register should use CRLF in HTTP requests

2014-02-21 Thread Éric Araujo
Éric Araujo added the comment: Some clarifications: * distutils2/packaging is now abandoned. * distutils can get bug fixes, unless they break e.g. work-arounds that have been working in setuptools or setup.py scripts for years. * distutils can get new features in 3.5. For this issue, I think

[issue20671] test_create_at_shutdown_with_encoding() of test_io hangs on SPARC Solaris 10 OpenCSW 3.x

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: I sent an email to Floris Bruynooghe, owner of the buildbot: Hi, I noticed Timeout (1:00:00)! errors on your buildbot SPARC Solaris 10 OpenCSW 3.x. It looks like the buildbot takes 10 hour for one build, whereas my PC takes less than 10 minutes (especially

[issue20717] test_4_daemon_threads() fails randomly on x86 Windows Server 2003 [SB] 3.x

2014-02-21 Thread STINNER Victor
New submission from STINNER Victor: The test test_4_daemon_threads() does crash randomly on the buildbot x86 Windows Server 2003 [SB] 3.x. It may be an old bug which was not seen before because it was hidden by another bug (#19424 which is now fixed). Charles-François Natali repeated that

[issue20717] test_4_daemon_threads() fails randomly on x86 Windows Server 2003 [SB] 3.x

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: I'm unable to reproduce the issue on my Windows XP and Windows 7 virtual machines. -- nosy: +brian.curtin, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20717

[issue20718] OpenBSD/AIX: tests passing a file descriptor with sendmsg/recvmsg failures

2014-02-21 Thread STINNER Victor
New submission from STINNER Victor: OpenBSD failures: http://bugs.python.org/issue20669#msg211493 AIX failures: http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/1760/steps/test/logs/stdio == ERROR:

[issue20718] OpenBSD/AIX: tests passing a file descriptor with sendmsg/recvmsg failures

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: These tests are skipped on Mac OS X: see issue #12958. We may skip also these tests on AIX and OpenBSD? (Copy the nosy list from issue #6560 which added the recvmsg() and sendmsg() methods.) -- nosy: +baikie, brett.cannon, brian, exarkun,

[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: I opened the issue #20718 to track the FD pass failures. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20669 ___

[issue20114] Sporadic failure of test_semaphore_tracker() of test_multiprocessing_forkserver on FreeBSD 9 buildbot

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: It is probably harmless then. It makes the buildbot red :-( I would like to see green buildbots :-) Similar failure on the buildbot SPARC Solaris 10 OpenCSW 3.x. A build takes between 9 and 10 hours on this buildbot.

[issue20641] Python installer needs elevated rights to install pip

2014-02-21 Thread Nick Coghlan
Nick Coghlan added the comment: Patrick, could you let us know exactly which version of Windows exhibited the problem? I also had no issues when testing the 3.4b3 installer on Windows 7 64-bit a few weeks ago, and I don't believe I have adjusted the UAC settings on that machine. --

[issue20719] test_robotparser failure on SPARC Solaris 10 (cc%2C 64b) [SB] 3.x buildbot

2014-02-21 Thread STINNER Victor
New submission from STINNER Victor: I read somewhere that python.org has a new website and the new website has gzip compression enabled which makes some urllib tests failing. It's probably related.

[issue20641] Python installer needs elevated rights to install pip

2014-02-21 Thread Martin v . Löwis
Martin v. Löwis added the comment: Also, what kind of account exactly is attempting to perform the installation? -- priority: release blocker - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20641

[issue20720] test_create_server() of test_asyncio failure on x86 Windows Server 2008 [SB] 3.x buildbot

2014-02-21 Thread STINNER Victor
New submission from STINNER Victor: It looks like the overlapped AcceptEx() operation was cancelled by something. But when the test_asyncio was replayed in verbose mode, the test passed. Is it possible that a local firewall or antivirus cancelled the operation? It would be surprising since

[issue20719] test_robotparser failure on SPARC Solaris 10 (cc%2C 64b) [SB] 3.x buildbot

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: http://buildbot.python.org/all/builders/x86%20FreeBSD%206.4%203.x/builds/4531/steps/test/logs/stdio == ERROR: testPythonOrg (test.test_robotparser.NetworkTestCase)

[issue20719] test_robotparser failure on SPARC Solaris 10 (cc%2C 64b) [SB] 3.x buildbot

2014-02-21 Thread STINNER Victor
STINNER Victor added the comment: http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%203.x/builds/2166/steps/test/logs/stdio == ERROR: testPythonOrg (test.test_robotparser.NetworkTestCase)

[issue20714] Allow for ]] in CDATA in minidom

2014-02-21 Thread Artur R. Czechowski
Artur R. Czechowski added the comment: Eric, I'm not sure what exactly your concern is, but I'll try to address two issues I can see. First: both strings ![CDATA[ and ![CDATA[]] are a correct and valid examples of CDATA usage as per specification[1]. Second: is it allowed to have two

[issue20653] Pickle enums by name

2014-02-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: __reduce_ex__ is not the preferred method: it's only necessary if you want so special-case according to the prototocol number. In most cases, this is not necessary so it is simpler to define __reduce__ and not __reduce_ex__. So I think the patch really should

[issue20679] 3.4 cherry-pick: 587fd4b91120 improve Enum subclass behavior

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Discussion started on PyDev. While working on that I realized/remembered that the main reason to get this in now is that without it a user *cannot* change how pickling works -- (s)he can write the methods, but they will be ignored. --

[issue20653] Pickle enums by name

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Many comments, Eli's and Serhey's code changes incorporated. -- Added file: http://bugs.python.org/file34173/issue20653.stoneleaf.02.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20653

[issue20653] Pickle enums by name

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Antoine, If the mixed-in class defines __reduce_ex__, and the Enum class defines __reduce__, pickle will see that the Enum class has both, and will call the _ex__ method. It is, therefore, the preferred method (at least by pickle, which is what we are

[issue20653] Pickle enums by name

2014-02-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: If the mixed-in class defines __reduce_ex__, and the Enum class defines __reduce__, pickle will see that the Enum class has both, and will call the _ex__ method. Ah, I understand your concern. You are using preferred in a different sense. The pickle docs

[issue20653] Pickle enums by name

2014-02-21 Thread Ethan Furman
Ethan Furman added the comment: Yeah, I was confused by that when I first read it as well. The 2.7 docs are even worse in that regard (so there has been some progress :). -- ___ Python tracker rep...@bugs.python.org

[issue20653] Pickle enums by name

2014-02-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yeah, I was confused by that when I first read it as well. The 2.7 docs are even worse in that regard (so there has been some progress :). The docs are actually correct. They may be confusing because the customization possibilities are more numerous than

  1   2   >