Re: conditional running of code portion

2012-08-05 Thread Steven D'Aprano
On Sat, 04 Aug 2012 21:16:04 -0700, JW Huang wrote: Hi, How can I implement something like C++'s conditional compile. if VERBOSE_MODE: print debug information else: do nothing But I don't want this condition to be checked during runtime as it will slow down the code. You've profiled

Re: On-topic: alternate Python implementations

2012-08-05 Thread Stefan Behnel
Stefan Behnel, 05.08.2012 07:46: Jürgen A. Erhard, 05.08.2012 01:25: None of the other implementations require Python for actually compiling or running Python source. Nuitka was on the list as well. Oh, and Stackless was also on Steven's list, as well as WPython. That means that 50% of the

Re: The way to develope a graphical application to manage a Postgres database

2012-08-05 Thread Wolfgang Keller
Can one advices me where to go? There are a number of Python frameworks for GUI database applications: - Dabo (wxPython) - Sqlkit (PyGTK SQLalchemy) - Pypapi (PyQt SQLalchemy) - Camelot (PyQt SQLalchemy) - Qtalchemy (PyQt SQLalchemy) - Openobject (PyGTK) - Defis (wxPython SQLalchemy),

Re: On-topic: alternate Python implementations

2012-08-05 Thread Jürgen A . Erhard
On Sun, Aug 05, 2012 at 07:46:59AM +0200, Stefan Behnel wrote: Jürgen A. Erhard, 05.08.2012 01:25: On Sat, Aug 04, 2012 at 08:40:16AM +0200, Stefan Behnel wrote: Steven D'Aprano, 04.08.2012 08:15: Most people are aware, if only vaguely, of the big Four Python implementations: And not

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Jean Dubois
On 5 aug, 02:11, shearich...@gmail.com wrote: One reason you may be having difficulty is that unlike some languages (C++/Java) object-orientation is not a be all and end all in Python, in fact you could work with Python for a long time without really 'doing it' at all (well other than

Re: Object Models - decoupling data access - good examples ?

2012-08-05 Thread Roy Smith
In article bf551938-0b08-46d5-82be-812c3521a...@googlegroups.com, shearich...@gmail.com wrote: Just out of curiosity, why do you eschew ORMs? Good question ! I'm not anti-ORM (in fact in many circs I'm quite pro-ORM) but for some time I've been working with a client who doesn't want

Re: dbf.py API question

2012-08-05 Thread Ethan Furman
Ole Martin Bjørndalen wrote: On Thu, Aug 2, 2012 at 5:55 PM, Ethan Furman et...@stoneleaf.us wrote: SQLite has a neat feature where if you give it a the file-name of ':memory:' the resulting table is in memory and not on disk. I thought it was a cool feature, but expanded it slightly: any name

Re: On-topic: alternate Python implementations

2012-08-05 Thread Ethan Furman
Mark Lawrence wrote: With arrogance like that German by any chance? Comments like that are not appropriate on this list. Please don't make them. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-05 Thread Ben Finney
Mark Lawrence breamore...@yahoo.co.uk writes: With arrogance like that German by any chance? Please keep derogatory national stereotypes off this forum and out of our community. They are counter to our goals of diversity URL:http://www.python.org/community/diversity/; you don't have to

Re: The way to develope a graphical application to manage a Postgres database

2012-08-05 Thread Walter Hurry
On Thu, 02 Aug 2012 20:24:36 +0200, Csanyi Pal wrote: I'm searching for a way to develope a Python graphical application for a Postgresql database. I use wxGlade/wxPython to build the GUI, and then hand code the database access using psycopg2 into the generated application. Works very well

Re: The way to develope a graphical application to manage a Postgres database

2012-08-05 Thread Csanyi Pal
Walter Hurry walterhu...@lavabit.com writes: On Thu, 02 Aug 2012 20:24:36 +0200, Csanyi Pal wrote: I'm searching for a way to develope a Python graphical application for a Postgresql database. I use wxGlade/wxPython to build the GUI, and then hand code the database access using psycopg2

Re: The way to develope a graphical application to manage a Postgres database

2012-08-05 Thread Walter Hurry
On Sun, 05 Aug 2012 17:58:46 +0200, Csanyi Pal wrote: Well, I tried out many adviced ways but none of them works on my Debian GNU/Linux testing/sid system. Always get some error in one of the part of the software. Can you give a short tutorial for newbies how to start to develope with

Re: conditional running of code portion

2012-08-05 Thread Serhiy Storchaka
On 05.08.12 09:30, Steven D'Aprano wrote: If you are working in a tight loop, you can do this: if VERBOSE_FLAG: for item in loop: print(DEBUG_INFORMATION) do_actual_work(item) else: for item in loop: do_actual_work(item) Or this: if VERBOSE_FLAG: def

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Jean Dubois
On 5 aug, 02:11, shearich...@gmail.com wrote: One reason you may be having difficulty is that unlike some languages (C++/Java) object-orientation is not a be all and end all in Python, in fact you could work with Python for a long time without really 'doing it' at all (well other than

Re: The way to develope a graphical application to manage a Postgres database

2012-08-05 Thread Mark Lawrence
On 05/08/2012 16:58, Csanyi Pal wrote: Walter Hurry walterhu...@lavabit.com writes: On Thu, 02 Aug 2012 20:24:36 +0200, Csanyi Pal wrote: I'm searching for a way to develope a Python graphical application for a Postgresql database. I use wxGlade/wxPython to build the GUI, and then hand

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Mark Lawrence
On 05/08/2012 19:04, Jean Dubois wrote: On 5 aug, 02:11, shearich...@gmail.com wrote: One reason you may be having difficulty is that unlike some languages (C++/Java) object-orientation is not a be all and end all in Python, in fact you could work with Python for a long time without really

Re: The way to develope a graphical application to manage a Postgres database

2012-08-05 Thread Csanyi Pal
Mark Lawrence breamore...@yahoo.co.uk writes: On 05/08/2012 16:58, Csanyi Pal wrote: Walter Hurry walterhu...@lavabit.com writes: On Thu, 02 Aug 2012 20:24:36 +0200, Csanyi Pal wrote: I'm searching for a way to develope a Python graphical application for a Postgresql database. I use

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Roy Smith
In article 8f1b60a5-0411-4aae-9ee6-0025b493c...@m13g2000vbd.googlegroups.com, Jean Dubois jeandubois...@gmail.com wrote: Can someone here on this list give a trivial example of what object oriented programming is, using only Python? OOP seems to mean different things to different people.

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Ifthikhan Nazeem
I would recommend Bruce Eckel's Thining in Python. Check it out here http://www.mindview.net/Books/TIPython/ On Sun, Aug 5, 2012 at 8:28 PM, Mark Lawrence breamore...@yahoo.co.ukwrote: On 05/08/2012 19:04, Jean Dubois wrote: On 5 aug, 02:11, shearich...@gmail.com wrote: One reason you may

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Mark Lawrence
On 05/08/2012 19:43, Ifthikhan Nazeem wrote: [top posting fixed] On Sun, Aug 5, 2012 at 8:28 PM, Mark Lawrence breamore...@yahoo.co.ukwrote: On 05/08/2012 19:04, Jean Dubois wrote: On 5 aug, 02:11, shearich...@gmail.com wrote: One reason you may be having difficulty is that unlike some

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread dncarac
I found Mark Lutz's book Learning Python had two or three chapters on object oriented programming from starting principles to more involved Python object programming. It helped me immensely. -- http://mail.python.org/mailman/listinfo/python-list

Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
I am currently using python 2.6 and am not going to install the newer versions of python and i am looking for people that are still using ver 2.6 in python to help with with the code line: sentence = All good things come to those who wait. then im getting this error message when i dont see the

Re: Intermediate Python user needed help

2012-08-05 Thread John Ladasky
Check line 76 of your code for errors. If line 76 is incorrectly formed, Python may see line 77 as a continuation of line 76 and throw the SyntaxError because of that. -- http://mail.python.org/mailman/listinfo/python-list

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
Well 75 and 76 is a blank line of text but i will see if i can take out those lines to see if it is the problem thanks John -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread lipska the kat
On 04/08/12 16:49, Jean Dubois wrote: I'm looking for a good introduction to object oriented programming with Python. rant Object Oriented programming is a mindset, a way of looking at that particular part of our world that you are trying to encapsulate in computer language. The language you

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
Ive tried to delete the spaces in 75 and 76 to see if it made a change but it has not made a difference to it. Here is the full code and the thing is i know there is things wrong with it but the thing is im fixing a code for a friend to help him getting with the coding: def

Re: Intermediate Python user needed help

2012-08-05 Thread Andrew Berg
On 8/5/2012 2:51 PM, John Mordecai Dildy wrote: print We'd have %d beans, %d jars, and %d crabapples. % secret_formula(start_pont sentence = All good things come to those who wait. You are missing a parenthesis at the end of the previous line. .print_first_word(sorted_words) That dot will

Re: Intermediate Python user needed help

2012-08-05 Thread xDog Walker
On Sunday 2012 August 05 12:51, John Mordecai Dildy wrote: print We'd have %d beans, %d jars, and %d crabapples. % secret_formula(start_pont Add a ) to the end of the line quoted above. -- Yonder nor sorghum stenches shut ladle gulls stopper torque wet strainers. --

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
well that work on mac though? im asking because i see the Windows NT at the bottom of your reply and plus im using 2.6 python not 3.3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
On Sunday, August 5, 2012 4:16:13 PM UTC-4, John Mordecai Dildy wrote: well that work on mac though? im asking because i see the Windows NT at the bottom of your reply and plus im using 2.6 python not 3.3 i see the ) problem i have it fixed --

Re: Intermediate Python user needed help

2012-08-05 Thread Steven D'Aprano
On Sun, 05 Aug 2012 12:51:31 -0700, John Mordecai Dildy wrote: Ive tried to delete the spaces in 75 and 76 to see if it made a change but it has not made a difference to it. What made you think that the problem could be fixed by deleting *spaces*? In general, making random changes to code in

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
File ex26.py, line 84 .print_first_word(sorted_words) ^ SyntaxError: invalid syntax is what i have now and i dont see the problem like usual (i only post problems that i cant fix). -- http://mail.python.org/mailman/listinfo/python-list

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
On Sunday, August 5, 2012 4:24:45 PM UTC-4, Steven D'Aprano wrote: On Sun, 05 Aug 2012 12:51:31 -0700, John Mordecai Dildy wrote: Ive tried to delete the spaces in 75 and 76 to see if it made a change but it has not made a difference to it. What made you think that the problem

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name 'start' is not defined anyone know how to make start defined -- http://mail.python.org/mailman/listinfo/python-list

Re: Intermediate Python user needed help

2012-08-05 Thread Tim Chase
On 08/05/12 15:52, John Mordecai Dildy wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name 'start' is not defined anyone know how to make start defined

Re: Intermediate Python user needed help

2012-08-05 Thread Roy Smith
In article 506eb405-eb07-4175-9efb-40475caba...@googlegroups.com, John Mordecai Dildy jdild...@gmail.com wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name 'start'

Re: Intermediate Python user needed help

2012-08-05 Thread Vlastimil Brom
2012/8/5 John Mordecai Dildy jdild...@gmail.com: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name 'start' is not defined anyone know how to make start defined --

Re: Intermediate Python user needed help

2012-08-05 Thread MRAB
On 05/08/2012 21:52, John Mordecai Dildy wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name 'start' is not defined anyone know how to make start defined You have

Re: Intermediate Python user needed help

2012-08-05 Thread Zero Piraeus
: On 5 August 2012 16:52, John Mordecai Dildy jdild...@gmail.com wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name 'start' is not defined anyone know how to make

Re: Intermediate Python user needed help

2012-08-05 Thread MRAB
On 05/08/2012 22:03, Tim Chase wrote: On 08/05/12 15:52, John Mordecai Dildy wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name 'start' is not defined anyone know how

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
Thanks everyone that has put input into this its working on out error by error On Sunday, August 5, 2012 5:03:50 PM UTC-4, Tim Chase wrote: On 08/05/12 15:52, John Mordecai Dildy wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
Im using Textwrangler and thats the only text editor that im using just saying for everyone -- http://mail.python.org/mailman/listinfo/python-list

Re: Intermediate Python user needed help

2012-08-05 Thread Andre Ramaciotti
On 08/05/2012 06:12 PM, MRAB wrote: On 05/08/2012 22:03, Tim Chase wrote: On 08/05/12 15:52, John Mordecai Dildy wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name

Re: Intermediate Python user needed help

2012-08-05 Thread Roy Smith
In article mailman.2972.1344200565.4697.python-l...@python.org, Tim Chase python.l...@tim.thechases.com wrote: On 08/05/12 15:52, John Mordecai Dildy wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates =

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
since when did we start talking about lisp? -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Mark Lawrence
On 05/08/2012 20:46, lipska the kat wrote: [snip] There is a book you could try, it's a bit dry and I read it when I can't sleep, about 30 mins usually does it :-) It's called Design Patterns by Gamma, Helm, Johnson and Vlissides ISBN 0-201-63361-2. They do use C++ code in examples but as they

Re: Intermediate Python user needed help

2012-08-05 Thread Mark Lawrence
On 05/08/2012 22:32, Roy Smith wrote: In article mailman.2972.1344200565.4697.python-l...@python.org, Tim Chase python.l...@tim.thechases.com wrote: On 08/05/12 15:52, John Mordecai Dildy wrote: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in

Re: Intermediate Python user needed help

2012-08-05 Thread Mark Lawrence
On 05/08/2012 23:00, John Mordecai Dildy wrote: since when did we start talking about lisp? Just about anything is on topic here. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Intermediate Python user needed help

2012-08-05 Thread John Mordecai Dildy
oh -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Roy Smith
On 05/08/2012 20:46, lipska the kat wrote: Design Patterns by Gamma, Helm, Johnson and Vlissides In article mailman.2980.1344204577.4697.python-l...@python.org, Mark Lawrence breamore...@yahoo.co.uk wrote: Please no, that's the worst possible book for someone trying to learn OOD in Python.

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Steven D'Aprano
On Sun, 05 Aug 2012 18:45:47 -0400, Dennis Lee Bieber wrote: Don't look for Object-Oriented Programming -- since the first widely popular OOP language was C++ (Smalltalk was earlier, but rather specialized, whereas C++ started as a preprocessor for C). Rather look for Object-Oriented

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Roy Smith
In article 501ef904$0$29867$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 05 Aug 2012 18:45:47 -0400, Dennis Lee Bieber wrote: Don't look for Object-Oriented Programming -- since the first widely popular OOP language was C++

Re: Intermediate Python user needed help

2012-08-05 Thread Tim Chase
On 08/05/12 17:00, John Mordecai Dildy wrote: since when did we start talking about lisp? Though not a lisper, the Python tie-in was my reply: Python (among many other languages) doesn't allow a - as a character in identifiers as you appeared to use it in your code. Unlike HTML, XML, CSS, and

Re: Intermediate Python user needed help

2012-08-05 Thread Tim Chase
On 08/05/12 16:32, Roy Smith wrote: Tim Chase python.l...@tim.thechases.com wrote: You either mean something like start_point (with an underscore instead of a minus), or you're performing a subtraction of start minus point, in which case you'd have to assign those values before you use them.

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Mark Lawrence
On 06/08/2012 00:12, Roy Smith wrote: In article 501ef904$0$29867$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 05 Aug 2012 18:45:47 -0400, Dennis Lee Bieber wrote: Don't look for Object-Oriented Programming -- since the first

Re: Intermediate Python user needed help

2012-08-05 Thread Roy Smith
In article mailman.2984.1344208723.4697.python-l...@python.org, Tim Chase python.l...@tim.thechases.com wrote: On 08/05/12 17:00, John Mordecai Dildy wrote: since when did we start talking about lisp? Though not a lisper, the Python tie-in was my reply: Python (among many other

Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread PeterSo
I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in IDLE # calculating the mean data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68, 78, 22, 25, 11] def mean(data): return sum(data)/len(data)

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread Rotwang
On 06/08/2012 00:46, PeterSo wrote: I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in IDLE # calculating the mean data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68, 78, 22, 25, 11] def mean(data):

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Steven D'Aprano
On Sun, 05 Aug 2012 20:46:23 +0100, lipska the kat wrote: rant Object Oriented programming is a mindset, a way of looking at that particular part of our world that you are trying to encapsulate in computer language. The language you use is (should be) irrelevant. That depends on how you

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Steven D'Aprano
On Sun, 05 Aug 2012 19:12:35 -0400, Roy Smith wrote: Good lord. I'd rather read C++ than UML. And I can't read C++. UML is under-rated. I certainly don't have any love of the 47 different flavors of diagram, but the basic idea of having a common graphical language for describing how

Re: Intermediate Python user needed help

2012-08-05 Thread William R. Wing
On Aug 5, 2012, at 5:14 PM, John Mordecai Dildy jdild...@gmail.com wrote: Im using Textwrangler and thats the only text editor that im using just saying for everyone -- http://mail.python.org/mailman/listinfo/python-list (With apologies, I initially sent this privately to John, and not to

Re: Intermediate Python user needed help

2012-08-05 Thread Steven D'Aprano
On Sun, 05 Aug 2012 18:19:55 -0500, Tim Chase wrote: On 08/05/12 17:00, John Mordecai Dildy wrote: since when did we start talking about lisp? Though not a lisper, the Python tie-in was my reply: Python (among many other languages) doesn't allow a - as a character in identifiers as you

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Dan Sommers
On 2012-08-06 at 00:27:43 +, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I frequently draw diagrams to understand the relationships between my classes and the problem I am trying to solve. I almost invariably use one type of box and one type of arrowhead. Sometimes if I'm

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread Mark Lawrence
On 06/08/2012 00:46, PeterSo wrote: I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in IDLE [snip] I can't comment on IDLE as I've never used it, but you're doing yourself a big disservice if you

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread MRAB
On 06/08/2012 01:09, Rotwang wrote: On 06/08/2012 00:46, PeterSo wrote: I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in IDLE # calculating the mean data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68,

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread Matthew Barnett
On 06/08/2012 01:58, MRAB wrote: On 06/08/2012 01:09, Rotwang wrote: On 06/08/2012 00:46, PeterSo wrote: I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in IDLE # calculating the mean data1=[49, 66,

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread Mark Lawrence
On 06/08/2012 01:22, Steven D'Aprano wrote: [snipped to death] In my not-so-humble opinion, the popularity of Design Patterns has a lot to do with the fact that they are so abstract and jargon-ridden that they have become a badge of membership into an elite. Shorn of their excessive

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread Rotwang
On 06/08/2012 02:01, Matthew Barnett wrote: On 06/08/2012 01:58, MRAB wrote: On 06/08/2012 01:09, Rotwang wrote: On 06/08/2012 00:46, PeterSo wrote: I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in

Re: Intermediate Python user needed help

2012-08-05 Thread Tim Chase
On 08/05/12 20:15, Dennis Lee Bieber wrote: On Sun, 05 Aug 2012 19:32:26 -0400, Roy Smith r...@panix.com declaimed Though not a lisper, the Python tie-in was my reply: Python (among many other languages) doesn't allow a - as a character in identifiers as you appeared to use it in your code.

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread Terry Reedy
On 8/5/2012 7:46 PM, PeterSo wrote: I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in IDLE # calculating the mean data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93, 68, 78, 22, 25, 11] def mean(data):

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread PeterSo
On Aug 5, 7:09 pm, Rotwang sg...@hotmail.co.uk wrote: On 06/08/2012 00:46, PeterSo wrote: I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in IDLE # calculating the mean data1=[49, 66,

Re: conditional running of code portion

2012-08-05 Thread Steven W. Orr
On 8/5/2012 12:43 AM, Ramchandra Apte wrote: Try pypreprocessor http://code.google.com/p/pypreprocessor/ . Better idea: You should be using the logging http://docs.python.org/library/logging.html module if you want to print debug information quickly.It uses threads and is optimized to run fast.

Re: Looking for a good introduction to object oriented programming with Python

2012-08-05 Thread alex23
On Aug 6, 10:22 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: In my not-so-humble opinion, the popularity of Design Patterns has a lot to do with the fact that they are so abstract and jargon-ridden that they have become a badge of membership into an elite. Shorn of their

Re: Intermediate Python user needed help

2012-08-05 Thread alex23
On Aug 6, 7:14 am, John Mordecai Dildy jdild...@gmail.com wrote: Im using Textwrangler and thats the only text editor that im using just saying for everyone Why bother using an actual development tool when you can get an entire mailing list to be your syntax checker, right? --

Re: On-topic: alternate Python implementations

2012-08-05 Thread alex23
On Aug 4, 4:15 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: But the Python ecosystem is a lot bigger than just those four. Here are just a few other implementations that you might be interested in: There's also HotPy: http://code.google.com/p/hotpy/ http://www.hotpy.org/

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about peek()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15546 ___ ___ Python-bugs-list mailing

[issue15539] Fixing Tools/scripts/pindent.py

2012-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 5. Fixed one type in help message. Typo. Should be Fixed one typo in help message. Patch updated, unused experimental variable removed. -- Added file: http://bugs.python.org/file26696/pindent.patch ___ Python

[issue15539] Fixing Tools/scripts/pindent.py

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file26665/pindent.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15539 ___

[issue15539] Fixing Tools/scripts/pindent.py

2012-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is now a test_tools, so it would be great to have tests to go along with this patch. Well, I'll do it. But the tests most likely will be different for different versions of Python (in contrast to the pindent patch). pindent -d and then pindent -c

[issue12428] functools test coverage

2012-08-05 Thread Brian Thorne
Brian Thorne added the comment: Back to a simpler closure implementation of partial and skip the repr test for python implementation. -- Added file: http://bugs.python.org/file26697/functools.patch ___ Python tracker rep...@bugs.python.org

[issue15559] Bad interaction between ipaddress addresses and the bytes constructor

2012-08-05 Thread Nick Coghlan
New submission from Nick Coghlan: I've been tinkering with the ipaddress module as I review Eli's documentation and have uncovered a *very* nasty interaction between ipaddress objects and the bytes constructor. Specifically, if you pass an integer to bytes() it will attempt to allocate and

[issue15559] Bad interaction between ipaddress addresses and the bytes constructor

2012-08-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5abea8a43f19 by Nick Coghlan in branch 'default': Close #15559: Implementing __index__ creates a nasty interaction with the bytes constructor. At least for 3.3, ipaddress objects must now be explicitly converted with int() and thus can't be passed

[issue1553375] Add traceback.print_full_exception()

2012-08-05 Thread Florent Xicluna
Florent Xicluna added the comment: Changeset ba014543ed2c (3.2a4) references this issue. -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1553375 ___

[issue15541] logging.exception doesn't accept 'extra'

2012-08-05 Thread Florent Xicluna
Florent Xicluna added the comment: Python 3.2 was already fixed with changeset ba014543ed2c. It would be nice to have some tests, though. -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15541

[issue15560] _sqlite3.so is built with wrong include file on OS X when using an SDK

2012-08-05 Thread Ned Deily
New submission from Ned Deily: setup.py supports building Python with an OS X SDK to allow building Python executables and libraries that will run on multiple versions of OS X. There is an error in the SDK support code in detect_modules() for building the _sqlite3 extension that has the

[issue15560] _sqlite3.so is built with wrong include file on OS X when using an SDK

2012-08-05 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- keywords: +patch Added file: http://bugs.python.org/file26698/issue15560_sqlite3_sdk.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15560 ___

[issue15560] _sqlite3.so is built with wrong include file on OS X when using an SDK

2012-08-05 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- stage: patch review - commit review Added file: http://bugs.python.org/file26699/issue15560_sqlite3_sdk_27_32.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15560

[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: We should not convert \n with -u command line option or PYTHONUNBUFFERED was set. Why that? What do universal newlines have to do with buffering? -- ___ Python tracker rep...@bugs.python.org

[issue15077] Regexp match goes into infinite loop

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15077 ___

[issue15239] Abandoned Tools/unicode/mkstringprep.py

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +needs review -patch priority: normal - low stage: - patch review type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15239

[issue15239] Abandoned Tools/unicode/mkstringprep.py

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15239 ___ ___ Python-bugs-list

[issue15144] Possible integer overflow in operations with addresses and sizes.

2012-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment:  Ah; were the strict aliasing problems already there before the patch? I didn't check. Please open separate issue for this. -- stage: - patch review ___ Python tracker rep...@bugs.python.org

[issue15144] Possible integer overflow in operations with addresses and sizes.

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +needs review priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15144 ___

[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15202 ___

[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-05 Thread Martin v . Löwis
Martin v. Löwis added the comment: I wonder why this is a release blocker. It's a bug in Python 3.2, so why should it block the release of 3.3 (it's not a regression). If no complete solution is coming up, I recommend to revert all changes on this issue, and reconsider after the 3.3 release.

[issue15378] Underported Tools/unicode/comparecodecs.py

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +needs review priority: normal - low stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15378 ___

[issue15379] Charmap decoding of no-BMP characters

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +needs review priority: normal - low stage: patch review - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15379 ___

[issue15379] Charmap decoding of no-BMP characters

2012-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15379 ___ ___

[issue13119] Newline for print() is \n on Windows, and not \r\n as expected

2012-08-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: I wonder why this is a release blocker. It's a bug in Python 3.2, so why should it block the release of 3.3 (it's not a regression). It's a blocker because the fix broke a couple of tests. And it's also a regression from 3.1 and 2.7. --

[issue15216] Support setting the encoding on a text stream after creation

2012-08-05 Thread Martin v . Löwis
Martin v. Löwis added the comment: I fail to see why this is a release blocker; no rationale is given in the original message, nor in the quoted message. So unblocking. -- nosy: +loewis priority: release blocker - normal ___ Python tracker

  1   2   >