[RELEASE] Python 2.7.2 release candidate 1

2011-05-30 Thread Benjamin Peterson
On behalf of the Python development team, I'm happy to announce the immediate availability of Python 2.7.2 release candidate 1. 2.7.2 is the second in bugfix release for the Python 2.7 series. 2.7 is the last major verison of the 2.x line and will be receiving bug fixes while new feature

[ANN] PyYAML-3.10: YAML parser and emitter for Python

2011-05-30 Thread Kirill Simonov
Announcing PyYAML-3.10 A new bug fix release of PyYAML is now available: http://pyyaml.org/wiki/PyYAML Changes === * Do not try to build LibYAML bindings on platforms other than CPython (Thank to olt(at)bogosoft(dot)com). * Clear

SQLObject 1.0.1

2011-05-30 Thread Oleg Broytman
Hello! I'm pleased to announce version 1.0.1, a bugfix release of branch 1.0 of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to

Re: float(nan) in set or as key

2011-05-30 Thread Steven D'Aprano
On Mon, 30 May 2011 04:29:19 +, Chris Torek wrote: In article 4de31635$0$29990$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: That's also completely wrong. The correct way to test for a NAN is with the IEEE-mandated function isnan(). The NAN

Re: float(nan) in set or as key

2011-05-30 Thread Steven D'Aprano
On Mon, 30 May 2011 04:15:11 +, Steven D'Aprano wrote: On Mon, 30 May 2011 11:14:58 +1000, Chris Angelico wrote: So, apart from float(nan), are there actually any places where real production code has to handle NaN? I was unable to get a nan by any of the above methods, except for

Re: scope of function parameters

2011-05-30 Thread Laurent Claessens
Le 29/05/2011 23:42, Ben Finney a écrit : Peter Pearsonppearson@nowhere.invalid writes: Python works in terms of objects having names, and one object can have many names. Or no names. So it's less accurate (though better than talking of “variables”) to speak of Python objects “having

Re: scope of function parameters

2011-05-30 Thread Chris Rebert
On Mon, May 30, 2011 at 12:12 AM, Laurent Claessens moky.m...@gmail.com wrote: Le 29/05/2011 23:42, Ben Finney a écrit : Peter Pearsonppearson@nowhere.invalid  writes:  Python works in terms of objects having names, and one  object can have many names. Or no names. So it's less accurate

Re: scope of function parameters

2011-05-30 Thread Laurent
Could you give an example of an object that has no name ? I've missed something ... def foo(): return 5 print(foo()) The int object 5 has no name here. Cool. I was thinking that 5 was the name, but 5.__add__(6) File stdin, line 1 5.__add__(6) ^ SyntaxError:

Re: scope of function parameters

2011-05-30 Thread Daniel Kluev
On Mon, May 30, 2011 at 6:12 PM, Laurent Claessens moky.m...@gmail.com wrote: Could you give an example of an object that has no name ? I've missed something ... object() object object at 0xb73d04d8 -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters

2011-05-30 Thread Terry Reedy
On 5/30/2011 3:38 AM, Laurent wrote: Cool. I was thinking that 5 was the name, but 5.__add__(6) File stdin, line 1 5.__add__(6) Try 5 .__add__(6) Modules, classes, and functions have a .__name__ attribute (I call it their 'definition name') used to print a representation. As best I can

Re: 3.1.4 release candidate 1

2011-05-30 Thread Alain Ketterlin
Raymond Hettinger pyt...@rcn.com writes: On May 29, 3:44 pm, Benjamin Peterson benja...@python.org wrote: On behalf of the Python development team, I'm happy as a swallow to announce a release candidate for the fourth bugfix release for the Python 3.1 series, Python 3.1.4. The Pi release

Re: scope of function parameters

2011-05-30 Thread Laurent Claessens
Le 30/05/2011 11:02, Terry Reedy a écrit : On 5/30/2011 3:38 AM, Laurent wrote: Cool. I was thinking that 5 was the name, but 5.__add__(6) File stdin, line 1 5.__add__(6) Try 5 .__add__(6) What is the rationale behind the fact to add a space between 5 and .__add__ ? Why does it

Best way to compute length of arbitrary dimension vector?

2011-05-30 Thread Gabriel
Well, the subject says it almost all: I'd like to write a small Vector class for arbitrary-dimensional vectors. I am wondering what would be the most efficient and/or most elegant way to compute the length of such a Vector? Right now, I've got def length(self):

Re: scope of function parameters

2011-05-30 Thread Steven D'Aprano
On Mon, 30 May 2011 11:08:23 +0200, Laurent Claessens wrote: Le 30/05/2011 11:02, Terry Reedy a écrit : On 5/30/2011 3:38 AM, Laurent wrote: Cool. I was thinking that 5 was the name, but 5.__add__(6) File stdin, line 1 5.__add__(6) Try 5 .__add__(6) What is the rationale

Re: scope of function parameters

2011-05-30 Thread Steven D'Aprano
On Mon, 30 May 2011 09:12:50 +0200, Laurent Claessens wrote: Could you give an example of an object that has no name ? I've missed something ... mylist = [None, 42, something] The list object has a name, mylist. The three objects inside the list have no names. -- Steven --

Re: scope of function parameters

2011-05-30 Thread Ben Finney
Laurent Claessens moky.m...@gmail.com writes: Le 30/05/2011 11:02, Terry Reedy a écrit : Try 5 .__add__(6) What is the rationale behind the fact to add a space between 5 and .__add__ ? Why does it work ? Try asking it the other way around. Why doesn't ‘5.__add__(6)’, without the space,

Re: Python's super() considered super!

2011-05-30 Thread Duncan Booth
Ethan Furman et...@stoneleaf.us wrote: foo(x=1, y=2, z=3) Traceback (most recent call last): File pyshell#8, line 1, in module foo(x=1, y=2, z=3) File pyshell#4, line 2, in foo bar(y=2, **kwargs) TypeError: bar() got multiple values for keyword argument 'y' And the above

Re: portable way of sending notifying a process

2011-05-30 Thread News123
Thanks for all your feedback. Well, I'll play a little and go either for a wrapper around ways to detecth a file change or for a tiny socket solution. Thanks again. On 05/30/2011 04:03 AM, Chris Angelico wrote: On Mon, May 30, 2011 at 11:44 AM, Chris Torek nos...@torek.net wrote: What would

Re: Best way to compute length of arbitrary dimension vector?

2011-05-30 Thread Chris Rebert
On Mon, May 30, 2011 at 2:11 AM, Gabriel snoopy.6...@googlemail.com wrote: Well, the subject says it almost all: I'd like to write a small Vector class for arbitrary-dimensional vectors. I am wondering what would be the most efficient and/or most elegant way to compute the length of such a

Re: scope of function parameters

2011-05-30 Thread Peter Otten
Laurent Claessens wrote: Le 30/05/2011 11:02, Terry Reedy a écrit : On 5/30/2011 3:38 AM, Laurent wrote: Cool. I was thinking that 5 was the name, but 5.__add__(6) File stdin, line 1 5.__add__(6) Try 5 .__add__(6) What is the rationale behind the fact to add a space between 5

Re: Best way to compute length of arbitrary dimension vector?

2011-05-30 Thread Peter Otten
Gabriel wrote: Well, the subject says it almost all: I'd like to write a small Vector class for arbitrary-dimensional vectors. I am wondering what would be the most efficient and/or most elegant way to compute the length of such a Vector? Right now, I've got def length(self):

Re: scope of function parameters

2011-05-30 Thread Laurent Claessens
What is the rationale behind the fact to add a space between 5 and .__add__ ? Why does it work ? It's a hint for the tokenizer. I didn't know the tokenizer. Now I understand. Thanks Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters

2011-05-30 Thread Laurent Claessens
What is the rationale behind the fact to add a space between 5 and .__add__ ? Why does it work ? It's a hint for the tokenizer. I didn't know the tokenizer. Now I understand. Thanks Laurent -- http://mail.python.org/mailman/listinfo/python-list

python in school notebooks/laptops

2011-05-30 Thread John Thornton
Hello Is it a waste of time to try to get school admins to put python in their school laptops? OK. Here's the crib for the rest[!] of the world. Here in Australia most secondary schools [that is kids from age approx 12-18] have some sort of netbook/laptop program. I have looked at

Re: scope of function parameters

2011-05-30 Thread Jussi Piitulainen
Laurent Claessens writes: Le 30/05/2011 11:02, Terry Reedy a écrit : On 5/30/2011 3:38 AM, Laurent wrote: Cool. I was thinking that 5 was the name, but 5.__add__(6) File stdin, line 1 5.__add__(6) Try 5 .__add__(6) What is the rationale behind the fact to add a space

Re: Abandoning Python

2011-05-30 Thread Piotr Kamiński
I'm sorry, I wanted to send the message below to the list and instead I sent it to just one user. Piotr Dnia 23-05-2011 o 10:29:24 Piotr Kamiński piotr.kamin...@poczta.onet.eu napisał(a): Dnia 23-05-2011 o 00:58:55 Brendan Simon (eTRIX) brendan.si...@etrix.com.au napisał(a): ... Take a

Re: python in school notebooks/laptops

2011-05-30 Thread hackingKK
On 30/05/11 15:45, John Thornton wrote: Hello Is it a waste of time to try to get school admins to put python in their school laptops? OK. Here's the crib for the rest[!] of the world. Here in Australia most secondary schools [that is kids from age approx 12-18] have some

Re: python in school notebooks/laptops

2011-05-30 Thread John Thornton
I agree fully. Linux is better and safer. But they seem hellbent on getting their students to use Windows. For laughs the kids in year 7 start off with this on their school netbook: Individual software packages MS Office Professional 2010 $80.30 (Word, Excel, PowerPoint, Access, Outlook,

SQLObject 1.0.1

2011-05-30 Thread Oleg Broytman
Hello! I'm pleased to announce version 1.0.1, a bugfix release of branch 1.0 of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to

Re: English Idiom in Unix: Directory Recursively

2011-05-30 Thread Peter Moylan
rantingrick wrote: On May 18, 7:19 am, Peter Moylan inva...@peter.pmoylan.org.invalid wrote: It's interesting to note that the definitions of 'recursive' to be found in Wikipedia and Wiktionary have very little in common with the definitions to be found in the dictionaries covered by

searching in list

2011-05-30 Thread vino19
I want to make a function that is called only once per one argument. I mean I want to store data of function calling to prevent calling it again if there is no need. How to make it? For example I can make a global list that just consist of tuples [(arg1, res1), (arg2, res2), ...]. Ok, how to

Re: English Idiom in Unix: Directory Recursively

2011-05-30 Thread Peter Moylan
rantingrick wrote: On May 18, 12:59 pm, s...@sig.for.address (Victor Eijkhout) wrote: Harrison Hill harrish...@gmx.com wrote: No need - I have the Dictionary definition of recursion here: Recursion: (N). See recursion. If you tell a joke, you have to tell it right. Jeez, speaking of bad

Re: searching in list

2011-05-30 Thread Dave Angel
On 01/-10/-28163 02:59 PM, vino19 wrote: I want to make a function that is called only once per one argument. I mean I want to store data of function calling to prevent calling it again if there is no need. How to make it? For example I can make a global list that just consist of tuples

Re: python in school notebooks/laptops

2011-05-30 Thread Chris Angelico
On Mon, May 30, 2011 at 8:15 PM, John Thornton secretel...@gmail.com wrote: Hello     Is it a waste of time to try to get school admins to put python in their school laptops? Two halves to this question. 1) Would it be of value if the school admins were to put Python on the school

Re: Best way to compute length of arbitrary dimension vector?

2011-05-30 Thread Gabriel
Thanks a lot to both of you, Chris Peter! (I knew the solution would be simple ... ;-) ) -- http://mail.python.org/mailman/listinfo/python-list

Re: searching in list

2011-05-30 Thread Chris Angelico
On Mon, May 30, 2011 at 10:58 PM, vino19 vinogra...@gmail.com wrote: I want to make a function that is called only once per one argument. I mean I want to store data of function calling to prevent calling it again if there is no need. How to make it? For example I can make a global list that

Re: searching in list

2011-05-30 Thread vino19
Thanks. It seems that dictionary is a sorted list of tuples, so the procedure of searching an element is quite quick. -- http://mail.python.org/mailman/listinfo/python-list

Re: python in school notebooks/laptops

2011-05-30 Thread jmfauth
On 30 mai, 13:09, hackingKK hackin...@gmail.com wrote: [...] Even better, try convincing them to use Ubuntu instead of  a virus called Where I Never Do Operations With Safety, or WINDOWS for short. That way Python will come by default  and VB will be out of question Happy hacking.

Re: searching in list

2011-05-30 Thread Chris Angelico
On Mon, May 30, 2011 at 11:50 PM, vino19 vinogra...@gmail.com wrote: Thanks. It seems that dictionary is a sorted list of tuples, so the procedure of searching an element is quite quick. Not sorted - it's hashed, so it's even faster. Yep, sounds like a dictionary is everything you want!

Re: How to catch a line with Popen

2011-05-30 Thread TheSaint
Chris Torek wrote: In at least some versions of Python 2 I'm with P3k :P. However thank you for your guidelines. Last my attempt was to use a *for* p.wait() , as mentioned earlier That looks good enough. I noted some little delay for the first lines, mostly sure Popen assign some buffer even

Re: searching in list

2011-05-30 Thread Ian Kelly
On Mon, May 30, 2011 at 7:41 AM, Chris Angelico ros...@gmail.com wrote: If you're always going to look them up by the argument, the best way would be to use a dictionary: cache={arg1: res1, arg2: res2, ...} Then you can search with a simple: cache[arg135] You can add things with:

Re: scope of function parameters

2011-05-30 Thread Terry Reedy
On 5/30/2011 5:08 AM, Laurent Claessens wrote: Le 30/05/2011 11:02, Terry Reedy a écrit : On 5/30/2011 3:38 AM, Laurent wrote: Cool. I was thinking that 5 was the name, but 5.__add__(6) File stdin, line 1 5.__add__(6) Try 5 .__add__(6) What is the rationale behind the fact to add a

3rd party tree/outline data structure module?

2011-05-30 Thread python
Before I reinvent the wheel, I'm wondering if anyone can recommend a 3rd party tree data structure module? (I do not need a GUI component) I've looked at ElementTree but I think(?) need something more flexible. I have a parser that reads a proprietary file format which defines an outline-like

Re: GIL in alternative implementations

2011-05-30 Thread Pascal Chambon
Thanks for the details on IronPython's implementation B-) Hopefully Pypy will eventually get rid of its own Gil, since it doesn't do refcounting either. Regards, Pascal Le 28/05/2011 00:52, Dino Viehland a écrit : In IronPython we have fine grained locking on our mutable data structures.

Re: How to Use Setuptools, Alternatives?

2011-05-30 Thread dough
On May 29, 10:41 pm, ray r...@aarden.us wrote: I have Python 2.7 on Win7 Pro on a tightly locked down desktop.  I would like to install Networkx from an egg.  From what I have read, Setuptools can be used for this. I don't know how to install Setuptools.  The exe will not work.  On

Re: Best way to compute length of arbitrary dimension vector?

2011-05-30 Thread Gabriel Genellina
En Mon, 30 May 2011 06:46:01 -0300, Peter Otten __pete...@web.de escribió: Gabriel wrote: Well, the subject says it almost all: I'd like to write a small Vector class for arbitrary-dimensional vectors. class Vector(object): ... def __init__(self, *coords): ...

Re: float(nan) in set or as key

2011-05-30 Thread Chris Torek
In article 4de3358b$0$29990$c3e8da3$54964...@news.astraweb.com Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Better than a float method is a function which takes any number as argument: import math, fractions, decimal math.isnan(fractions.Fraction(2, 3)) False

Re: English Idiom in Unix: Directory Recursively

2011-05-30 Thread Rikishi42
On 2011-05-28, Chris Angelico ros...@gmail.com wrote: I think it's geographic. This list covers a lot of geography; I'm in Australia, there are quite a few Brits, and probably the bulk of posts come from either the US or Europe. (And yes, I did deliberately fold all of Europe down to one

Re: English Idiom in Unix: Directory Recursively

2011-05-30 Thread Rikishi42
On 2011-05-28, Chris Angelico ros...@gmail.com wrote: Chris Angelico yes, bit of a Bible geek as well as a programming geek So you don't believe in genetic algorithms, then ? (ducking for cover) -- When in doubt, use brute force. -- Ken Thompson --

Re: How to catch a line with Popen

2011-05-30 Thread Chris Torek
Chris Torek wrote: In at least some versions of Python 2 [the file-type object iterators behave badly with pipes] (This may still be true in Python 3, I just have no experience with Py3k. At least some version of Python 2 means the ones I have access to, and have tried. :-) ) In article

sqlalchemy and Unicode strings: errormessage

2011-05-30 Thread Wolfgang Meiners
Hi, I am trying to build an application using sqlalchemy. in principle i have the structure #== from sqlalchemy import * from sqlalchemy.orm import * metadata = MetaData('sqlite://') a_table = Table('tf_lehrer', metadata, Column('id', Integer,

Re: python in school notebooks/laptops

2011-05-30 Thread Irmen de Jong
On 30-5-2011 16:30, jmfauth wrote: On 30 mai, 13:09, hackingKK hackin...@gmail.com wrote: [...] Even better, try convincing them to use Ubuntu instead of a virus called Where I Never Do Operations With Safety, or WINDOWS for short. That way Python will come by default and VB will be

Pydev 2.1.0 Released

2011-05-30 Thread Fabio Zadrozny
Hi All, Pydev 2.1.0 has been released Details on Pydev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- Code Analysis By default, only the currently opened editor will be analyzed (resulting in much shorter build

Re: English Idiom in Unix: Directory Recursively

2011-05-30 Thread Steven D'Aprano
On Mon, 30 May 2011 23:04:41 +0200, Rikishi42 wrote: On 2011-05-28, Chris Angelico ros...@gmail.com wrote: I think it's geographic. This list covers a lot of geography; I'm in Australia, there are quite a few Brits, and probably the bulk of posts come from either the US or Europe. (And yes, I

Re: float(nan) in set or as key

2011-05-30 Thread Steven D'Aprano
On Mon, 30 May 2011 19:58:35 +, Chris Torek wrote: In article 4de3358b$0$29990$c3e8da3$54964...@news.astraweb.com Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Better than a float method is a function which takes any number as argument: import math, fractions, decimal

Re: scope of function parameters (take two)

2011-05-30 Thread Henry Olders
On 2011-05-29, at 4:30 , Henry Olders wrote: I just spent a considerable amount of time and effort debugging a program. The made-up code snippet below illustrates the problem I encountered: def main(): a = ['a list','with','three elements'] print a print fnc1(a)

Re: Beginner needs advice

2011-05-30 Thread harrismh777
Steven D'Aprano wrote: LOL I invite you to consider the difference between a legally dead person moments before being resuscitated by a paramedic, ( ... alive ) versus a chicken that has just been beheaded and is still running around the yard, ( ... alive ) versus a

Re: Beginner needs advice

2011-05-30 Thread harrismh777
Ian Kelly wrote: You have just misrepresented Steven's argument, which is rather ironic considering that you're the one who brought up straw-men. Steven did not use one code snippet to demonstrate that Python 2 and Python 3 are fully compatible. The code snippet merely demonstrated that Python

Re: Beginner needs advice

2011-05-30 Thread harrismh777
Jason Tackaberry wrote: At least, his arguments make more sense if I read him as arguing from the not completely compatible position. It's possible he is intentionally equivocating for dramatic effect. yes -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters (take two)

2011-05-30 Thread Benjamin Kaplan
On Mon, May 30, 2011 at 5:28 PM, Henry Olders henry.old...@mcgill.ca wrote: On 2011-05-29, at 4:30 , Henry Olders wrote: I just spent a considerable amount of time and effort debugging a program. The made-up code snippet below illustrates the problem I encountered: def main():       a =

Re: python in school notebooks/laptops

2011-05-30 Thread harrismh777
Chris Angelico wrote: Is it a waste of time to try to get school admins to put python in their school laptops? No, absolutely no... Python advocacy is necessary in this venue ! Possibly the best way to encourage Python deployment would be to require it to run some internal

Re: Beginner needs advice

2011-05-30 Thread Rhodri James
On Tue, 31 May 2011 01:32:01 +0100, harrismh777 harrismh...@charter.net wrote: Steven D'Aprano wrote: Compatibility is inherently continuous, a matter of degree. Compatible by degrees is incompatible. Just 'how' incompatible determines whether the factor(s) are utterly useless, or

Re: scope of function parameters (take two)

2011-05-30 Thread Daniel Kluev
On Tue, May 31, 2011 at 11:28 AM, Henry Olders henry.old...@mcgill.ca wrote: What I would like is that the variables which are included in the function definition's parameter list, would be always treated as local to that function You still mis-reading docs and explanations you received from

Re: python in school notebooks/laptops

2011-05-30 Thread Terry Reedy
On 5/30/2011 6:15 PM, Irmen de Jong wrote: Do you mean one of these os's, where Python (2) is not working properly because the *defaultencoding* is set to utf-8? Huh? On all of my machines, including windows and Ubuntu 11.04, sys.getdefaultencoding() returns 'ascii'. For me, WINXP, 2.7

Re: Beginner needs advice

2011-05-30 Thread Ian Kelly
On Mon, May 30, 2011 at 6:43 PM, harrismh777 harrismh...@charter.net wrote: I realize you are now asserting that compatibility is a boolean condition, and that totally incompatible is a redundant phrase that you tossed out as a joke.  I don't know whether you're sincere or backpedaling, but in

Re: scope of function parameters (take two)

2011-05-30 Thread Terry Reedy
On 5/30/2011 8:28 PM, Henry Olders wrote: Sadly, I feel that the main issue that I was trying to address, has not been dealt with. False. Please go back and read what I and others wrote before. ... What I would like is that the variables which are included in the function definition's

Re: Beginner needs advice

2011-05-30 Thread Terry Reedy
On 5/30/2011 8:32 PM, harrismh777 wrote: Ever tried to read Beowulf in the original? Ever tried to write Ænglisc ? I have, and it is a lot further from modern American than Python 2 and 3 are from each other. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner needs advice

2011-05-30 Thread Terry Reedy
On 5/30/2011 8:32 PM, harrismh777 wrote: However, I guarantee that if I'm dumped unaided in Piccadilly I'll be able to hail a cab, pay my £12.00 and get myself to Liverpool Street Station, find the bathroom, and be on the correct train just in time for dinner, all without looking into the

Re: scope of function parameters (take two)

2011-05-30 Thread Daniel Kluev
On Tue, May 31, 2011 at 12:30 PM, Terry Reedy tjre...@udel.edu wrote: Again, go back and reread what I and other wrote. I believe that you are, in part, hypnotized by the work 'variable'. Can you define the word? There are 10 to 20 possible variations, and yours is probably wrong for Python.

Re: Beginner needs advice

2011-05-30 Thread Chris Angelico
On Tue, May 31, 2011 at 11:16 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Mon, May 30, 2011 at 6:43 PM, harrismh777 harrismh...@charter.net wrote:  If you disagree, then I invite you to list one example of two different things that are compatible.   one man, and one woman Now you're

Re: python in school notebooks/laptops

2011-05-30 Thread Chris Angelico
On Tue, May 31, 2011 at 10:57 AM, harrismh777 harrismh...@charter.net wrote: Chris Angelico wrote: Possibly the best way to encourage Python deployment would be to require it to run some internal script.   Chris has a great idea here... but I think more along the lines of an app that

Re: Beginner needs advice

2011-05-30 Thread harrismh777
Chris Angelico wrote: Hmm. If you did write those two scripting languages, we would finally be able to type man woman to get docs on how to talk to women... Which just wouldn't be fair, because her use of man man would lead her no closer to understanding how men speak... (er, think,

Re: scope of function parameters (take two)

2011-05-30 Thread Chris Angelico
On Tue, May 31, 2011 at 10:28 AM, Henry Olders henry.old...@mcgill.ca wrote: I don't believe I'm the only person who thinks this way. Here is a quote from wikipedia: It is considered good programming practice to make the scope of variables as narrow as feasible so that different parts of a

Re: scope of function parameters (take two)

2011-05-30 Thread Daniel Kluev
On Tue, May 31, 2011 at 2:05 PM, Chris Angelico ros...@gmail.com wrote: Infinitely-nested scoping is simply one of the casualties of a non-declarative language. Well, this is not accurate, as you can have 'infinitely-nested scoping' in python, in form of nested functions. For example, you can

Re: scope of function parameters (take two)

2011-05-30 Thread Chris Angelico
On Tue, May 31, 2011 at 1:18 PM, Daniel Kluev dan.kl...@gmail.com wrote: On Tue, May 31, 2011 at 2:05 PM, Chris Angelico ros...@gmail.com wrote: Infinitely-nested scoping is simply one of the casualties of a non-declarative language. Well, this is not accurate, as you can have

pydev ant build

2011-05-30 Thread prakash jp
Hi all, Could any one provide relevant url/s on the usage of *pyant* scripts and its setup as well Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters (take two)

2011-05-30 Thread Dan Stromberg
On Mon, May 30, 2011 at 5:28 PM, Henry Olders henry.old...@mcgill.cawrote: What I would like is that the variables which are included in the function definition's parameter list, would be always treated as local to that function (and of course, accessible to nested functions) but NOT global

Re: scope of function parameters (take two)

2011-05-30 Thread Steven D'Aprano
On Mon, 30 May 2011 20:28:34 -0400, Henry Olders wrote: I am trying to write python programs in a more-or-less functional programming mode, ie functions without side effects (except for print statements, which are very helpful for debugging). This is easiest when all variables declared in

Re: scope of function parameters (take two)

2011-05-30 Thread Wolfgang Rohdewald
On Dienstag 31 Mai 2011, Henry Olders wrote: What I would like is that the variables which are included in the function definition's parameter list, would be always treated as local to that function (and of course, accessible to nested functions) but NOT global unless explicitly defined as

Re: scope of function parameters (take two)

2011-05-30 Thread Thomas Rachel
Am 31.05.2011 02:28 schrieb Henry Olders: This suggests that the decision to make unassigned (ie free variables) have a global scope, was made somewhat arbitrarily to prevent clutter. But I don't believe that the feared clutter would materialize. My understanding is that when a variable is

Re: scope of function parameters (take two)

2011-05-30 Thread Ben Finney
Daniel Kluev dan.kl...@gmail.com writes: On a sidenote, I wonder what is the reason to keep word 'variable' in python documentation at all. I believe word 'name' represents concept better, and those, who come from other languages, would be less likely to associate wrong definitions with it.

Re: Beginner needs advice

2011-05-30 Thread Benjamin Kaplan
On Mon, May 30, 2011 at 10:20 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Mon, 30 May 2011 21:34:09 -0400, Terry Reedy tjre...@udel.edu declaimed the following in gmane.comp.python.general: On 5/30/2011 8:32 PM, harrismh777 wrote: Ever tried to read Beowulf in the original? Ever

Re: scope of function parameters (take two)

2011-05-30 Thread Daniel Kluev
On Tue, May 31, 2011 at 4:13 PM, Wolfgang Rohdewald wolfg...@rohdewald.de wrote: what you really seem to want is that a function by default cannot have any side effects (you have a side effect if a function changes things outside of its local scope). But that would be a very different language

Re: Beginner needs advice

2011-05-30 Thread Ben Finney
Dennis Lee Bieber wlfr...@ix.netcom.com writes: Well... He did say find the bathroom, not ask for directions to whatever euphemism is in current usage (water closet, W/C, loo ?) The room which contains the bath is the bathroom. Assuming that the toilet is in the same room as the bath is

[issue11623] Distutils is reporting OSX 10.6 w/ XCode 4 as universal

2011-05-30 Thread sorin
sorin sorin.sbar...@gmail.com added the comment: FYI, I got the above output from 10.7 from a friend, I do not have access to the seed, so the information could be wrong. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11623

[issue12206] Documentation Std. Library 15.7.5 LogRecord objects: Parameters: level(currently wrong) - levelno (correct)

2011-05-30 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: The name of the level parameter to LogRecord constructor is correct in the documentation (I checked the code). The only inconsitency that I see is that the corresponding attribute name of LogRecord is levelno. -- nosy: +petri.lehtinen

[issue12206] Documentation Std. Library 15.7.5 LogRecord objects: Parameters: level(currently wrong) - levelno (correct)

2011-05-30 Thread Martin Ponweiser
Martin Ponweiser m.ponwei...@gmail.com added the comment: You are right, I should have looked closer -- sorry to all involved. Nevertheless this caused some confusion here. I guess mentioning the inconsistency in the documentation is out of the question. On Mon, May 30, 2011 at 10:10 AM, Petri

[issue12206] Documentation Std. Library 15.7.5 LogRecord objects: Parameters: level(currently wrong) - levelno (correct)

2011-05-30 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Martin Ponweiser wrote: I guess mentioning the inconsistency in the documentation is out of the question. No, not at all. If you have a good wording in your mind, please share it :) Or even better, write a patch. --

[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input

2011-05-30 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___

[issue12198] zipfile.py:1047: DeprecationWarning: 'H' format requires 0 = number = 65535

2011-05-30 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: On 2.7, your example raises an error: Traceback (most recent call last): File a.py, line 7, in module z.write(a, a) File /home/petri/tmp/cpython/cpython/Lib/zipfile.py, line 1071, in write self.fp.write(zinfo.FileHeader()) File

[issue12014] str.format parses replacement field incorrectly

2011-05-30 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list

[issue12151] test_logging fails sometimes

2011-05-30 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: The last change appears to have fixed the problem; AFAIK there have been no test_logging failures on the buildbots for several days. -- resolution: - fixed status: open - closed ___ Python

[issue12068] test_logging failure in test_rollover

2011-05-30 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: There appear to have been no test_logging failures on the buildbots for around a week, so closing this issue. A change to ignore socket errors when the server was closed appears to have done the trick. -- resolution: - fixed

[issue12151] test_logging fails sometimes

2011-05-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: The last change appears to have fixed the problem; AFAIK there have been no test_logging failures on the buildbots for several days. Great job, thanks! -- ___ Python tracker

[issue11254] distutils doesn't byte-compile .py files to __pycache__ during installation

2011-05-30 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com added the comment: to be backported in packaging -- in a way that will make it work with previous python versions for the incoming 2.x backport -- ___ Python tracker rep...@bugs.python.org

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-30 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: I'm not. My patch doesn't address the problem of unlinkable methods but wrong type declarations (read, wrong usage of .. function:: directives) for builtins like int, float, bool, list etc. Because the directives change, the roles used to link to

[issue6490] os.popen documentation in 2.6 is probably wrong

2011-05-30 Thread Chris Rebert
Chris Rebert pyb...@rebertia.com added the comment: Per msg129958, attached is my stab at a patch to replace most uses of os.popen() with the subprocess module. The test suite passes on my Mac, but the patch does touch some specific-to-other-platform code, so further testing is obviously

[issue6490] os.popen documentation in 2.6 is probably wrong

2011-05-30 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Chris Rebert wrote: Chris Rebert pyb...@rebertia.com added the comment: Per msg129958, attached is my stab at a patch to replace most uses of os.popen() with the subprocess module. The test suite passes on my Mac, but the patch does

[issue12213] BufferedRandom, BufferedRWPair: issues with interlaced read-write

2011-05-30 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- title: BufferedRandom: write(); read() gives different result using io and _pyio - BufferedRandom, BufferedRWPair: issues with interlaced read-write ___ Python tracker rep...@bugs.python.org

[issue12125] test_sysconfig fails on OpenIndiana because of test_packaging

2011-05-30 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Tarek, can you confirm that the bug is closed?. It is reported as open in the tracker. Could you possibly close it, if appropiate?. -- assignee: tarek - ___ Python tracker rep...@bugs.python.org

  1   2   3   >