Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Laxmikant Chitare
Thank you all for the enlightening inputs. I have learnt a lot just with this one question. Great to know about dis library. Ned, from explanation I now realize how important it is to do impact analysis. Things are not always rosy :). I have always appreciated everyone over this list. This is just

Re

2014-02-17 Thread Terry Reedy
On 2/17/2014 7:58 PM, Physics wrote: A response to a spammer who changed email to avoid filters. If you want to do anything, forward the message with headers to Original-X-Complaints-To: ab...@aioe.org asking them to try harder to block the person. -- Terry Jan Reedy -- https://mail.python.or

Re: Google Cloud Platform and GlassSolver Project

2014-02-17 Thread Chris Angelico
On Tue, Feb 18, 2014 at 1:52 PM, Steven D'Aprano wrote: > On Mon, 17 Feb 2014 16:57:34 -0800, Physics wrote: > >> Does ANYONE have a clue how to do this? I understand that it is hard but >> geez... > > > Absolutely no clue what your question is. You seem to assume that: > > - we know what "God's a

Re: Google Cloud Platform and GlassSolver Project

2014-02-17 Thread Steven D'Aprano
On Mon, 17 Feb 2014 16:57:34 -0800, Physics wrote: > Does ANYONE have a clue how to do this? I understand that it is hard but > geez... Absolutely no clue what your question is. You seem to assume that: - we know what "God's algorithm" is; - we know what "God's Number" is; - we understand wha

Re: select(sock) indicates not-ready, but sock.recv does not block

2014-02-17 Thread Nikolaus Rath
Nikolaus Rath writes: > Hello, > > I have a problem with using select. I can reliably reproduce a situation > where select.select((sock.fileno(),), (), (), 0) returns ((),(),()) > (i.e., no data ready for reading), but an immediately following > sock.recv() returns data without blocking. [...] Tu

Re: NEW INFORMATION ON HUMAN DEVONIAN ORIGINS

2014-02-17 Thread Chris Angelico
On Tue, Feb 18, 2014 at 11:58 AM, Physics wrote: > On Monday, February 17, 2014 7:44:20 PM UTC-5, MAOIST wrote: >> [ link deleted ] >> -- >> Thrinaxodon, the ultimate defender of USENET. > > What > The > HELL? These are just spam. Ignore them. And if you must respond, please remove the link :) C

Re: NEW INFORMATION ON HUMAN DEVONIAN ORIGINS

2014-02-17 Thread Physics
On Monday, February 17, 2014 7:44:20 PM UTC-5, MAOIST wrote: > http://thrinaxodon.wordpress.com/faq/ > -- > Thrinaxodon, the ultimate defender of USENET. What The HELL? -- https://mail.python.org/mailman/listinfo/python-list

Re: Google Cloud Platform and GlassSolver Project

2014-02-17 Thread Physics
Does ANYONE have a clue how to do this? I understand that it is hard but geez... -- https://mail.python.org/mailman/listinfo/python-list

NEW INFORMATION ON HUMAN DEVONIAN ORIGINS

2014-02-17 Thread MAOIST
http://thrinaxodon.wordpress.com/faq/ -- Thrinaxodon, the ultimate defender of USENET. -- https://mail.python.org/mailman/listinfo/python-list

Re: Import order question

2014-02-17 Thread Ben Finney
Nagy László Zsolt writes: > > Use modules to group your class definitions conceptually. There is > > no need whatever to separate every class into a different module. > If there is a consensus, and it is really desireable to put all these > related classes into the same module, then this is what

Re: Problem importing libraries installed with PIP in Eclipse

2014-02-17 Thread Renato Vernucio
Hi Fabio, I wish I could use the latest PyDev, unfortunately I need Aptana studio. It's a pity they won't let us install individual packages from their bundle. If they did, I could install only the other packages and install PyDev separately. Thanks for your help once again. Yours, Renato 2014

Re: Why is the interpreter is returning a 'reference'?

2014-02-17 Thread John Gordon
In <9b80c233-ad31-44c8-8a6e-9002ab11b...@googlegroups.com> Nir writes: > >>> k = ['hi','boss'] > >>> > >>> k > ['hi', 'boss'] > >>> k= [s.upper for s in k] > >>> k > [, method upper of str object at 0x02283F58>] > Why doesn't the python interpreter just return > ['HI, 'BOSS'] ? > This

Re: How to use logging

2014-02-17 Thread John Gordon
In <5a53c1ca-1104-40f2-9401-a6d3b3673...@googlegroups.com> kumar writes: > Hi folks, > i'm new to python i understood the logging mechanism but unable to > understand how these are applied in real time examples can any body help > me out Here are some very simple examples: import logging

Re: Problem importing libraries installed with PIP in Eclipse

2014-02-17 Thread Fabio Zadrozny
On Sun, Feb 16, 2014 at 11:52 AM, Renato wrote: > It's solved now, oh my god I was so stupid! I created a package named > "pybrain" for testing PyBrain module, so obviously when I tryed to import > something from PyBrain library, Python would import all modules from this > personal package I crea

Re: Import order question

2014-02-17 Thread Dave Angel
Terry Reedy Wrote in message: > On 2/17/2014 8:01 AM, Nagy László Zsolt wrote: >> I have a class hierarchy like this: >> >> Widget <- VisualWidget <- BsWidget >> >> and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. >> >> Widgets can have children. They are stored in a tr

Re: Explanation of list reference

2014-02-17 Thread Rotwang
On 17/02/2014 06:21, Steven D'Aprano wrote: On Mon, 17 Feb 2014 11:54:45 +1300, Gregory Ewing wrote: [...] [1] Mathematicians tried this. "Everything is a set!" Yeah, right... No, that's okay. You only get into trouble when you have self-referential sets, like "the set of all sets that don't

Re: Import order question

2014-02-17 Thread Nagy László Zsolt
Here is the problem: these methods should create instances of Row, Column and Navbar. But this leads to circular imports. It should not; Python is not Java. Use modules to group your class definitions conceptually. There is no need whatever to separate every class into a different module. If t

Re: Getting a stable virtual env

2014-02-17 Thread JM
This one should be in plain text, sorry guys I'm trying to get used to this new mail address and client. Hi ppl, I'm trying to figure out the whole virtualenv story. Right now I'm using it to creating an environment for our upcoming debian upgrade to squeeze. I'm doing some tests in our current

Getting a stable virtual env

2014-02-17 Thread P J
Hi ppl, I'm trying to figure out the whole virtualenv story. Right now I'm using it to creating an environment for our upcoming debian upgrade to squeeze. I'm doing some tests in our current distrib (python 2.5). I have come to realize that a lot of packages in the version I'm interested in are n

Re: Why is the interpreter is returning a 'reference'?

2014-02-17 Thread Zachary Ware
On Mon, Feb 17, 2014 at 11:00 AM, Nir wrote: k = ['hi','boss'] k > ['hi', 'boss'] k= [s.upper for s in k] k > [, method upper of str object at 0x02283F58>] > > Why doesn't the python interpreter just return > ['HI, 'BOSS'] ? It's just doing exactly what you are t

Re: Why is the interpreter is returning a 'reference'?

2014-02-17 Thread Marko Rauhamaa
Nir : k= [s.upper for s in k] k > [, method upper of str object at 0x02283F58>] > > Why doesn't the python interpreter just return > ['HI, 'BOSS'] ? Try: k = [ s.upper() for s in k ] Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is the interpreter is returning a 'reference'?

2014-02-17 Thread emile
On 02/17/2014 09:00 AM, Nir wrote: k = ['hi','boss'] k ['hi', 'boss'] k= [s.upper for s in k] s.upper is a reference to the method upper of s -- to execute the method add parens -- s.upper() Emile k [, ] Why doesn't the python interpreter just return ['HI, 'BOSS'] ? This isn't a big

Re: Why is the interpreter is returning a 'reference'?

2014-02-17 Thread Ned Batchelder
On 2/17/14 12:00 PM, Nir wrote: k = ['hi','boss'] k ['hi', 'boss'] k= [s.upper for s in k] k [, ] Why doesn't the python interpreter just return ['HI, 'BOSS'] ? This isn't a big deal, but I am just curious as to why it does this. You have to invoke s.upper, with parens: k = [s.upper

Re: Why is the interpreter is returning a 'reference'?

2014-02-17 Thread Joel Goldstick
On Feb 17, 2014 12:05 PM, "Nir" wrote: > > >>> k = ['hi','boss'] > >>> > >>> k > ['hi', 'boss'] > >>> k= [s.upper for s in k S.upper() > >>> k > [, ] > > Why doesn't the python interpreter just return > ['HI, 'BOSS'] ? > > This isn't a big deal, but I am just curious as to why it does this. > -- >

Why is the interpreter is returning a 'reference'?

2014-02-17 Thread Nir
>>> k = ['hi','boss'] >>> >>> k ['hi', 'boss'] >>> k= [s.upper for s in k] >>> k [, ] Why doesn't the python interpreter just return ['HI, 'BOSS'] ? This isn't a big deal, but I am just curious as to why it does this. -- https://mail.python.org/mailman/listinfo/python-list

Re: Import order question

2014-02-17 Thread Terry Reedy
On 2/17/2014 8:01 AM, Nagy László Zsolt wrote: I have a class hierarchy like this: Widget <- VisualWidget <- BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. Widgets can have children. They are stored in a tree. In order to manage the order of widgets, I need

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Terry Reedy
On 2/17/2014 3:59 AM, Steven D'Aprano wrote: On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html Just wanted to clarify whether CPython already includes these kind of byte

Re: Explanation of list reference

2014-02-17 Thread Rustom Mody
On Monday, February 17, 2014 12:01:18 PM UTC+5:30, Steven D'Aprano wrote: > I take it that you haven't spent much time around beginners? Perhaps you > should spend some time on the "tutor" mailing list. If you do, you will > see very few abstract or philosophical questions such as whether > refe

Re: Import order question

2014-02-17 Thread Peter Otten
Nagy László Zsolt wrote: > I have a class hierarchy like this: > > Widget <- VisualWidget <- BsWidget > > and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. > > Widgets can have children. They are stored in a tree. In order to manage > the order of widgets, I need methods

Re: Import order question

2014-02-17 Thread Ben Finney
Nagy László Zsolt writes: > I have a class hierarchy like this: > > Widget <- VisualWidget <- BsWidget > > and then BsWidget has many descendants: Desktop, Row, Column, Navbar > etc. None of this implies anything about which modules you place these in; Python is not Java, and you should be putti

Re: select(sock) indicates not-ready, but sock.recv does not block

2014-02-17 Thread Roy Smith
In article , Nikolaus Rath wrote: > Hello, > > I have a problem with using select. I can reliably reproduce a situation > where select.select((sock.fileno(),), (), (), 0) returns ((),(),()) > (i.e., no data ready for reading), but an immediately following > sock.recv() returns data without bloc

Import order question

2014-02-17 Thread Nagy László Zsolt
I have a class hierarchy like this: Widget <- VisualWidget <- BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. Widgets can have children. They are stored in a tree. In order to manage the order of widgets, I need methods to append children. (And later: insert

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Ned Batchelder
On 2/17/14 3:59 AM, Steven D'Aprano wrote: On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html Just wanted to clarify whether CPython already includes these kind of byte c

[OT]Internet Trolls Really Are Horrible People

2014-02-17 Thread Mark Lawrence
http://www.slate.com/articles/health_and_science/climate_desk/2014/02/internet_troll_personality_study_machiavellianism_narcissism_psychopathy.html Dedicated to all trolls everywhere. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mar

Re: How to use logging

2014-02-17 Thread Mark Lawrence
On 17/02/2014 07:37, kumar wrote: Hi folks, i'm new to python i understood the logging mechanism but unable to understand how these are applied in real time examples can any body help me out Start here http://docs.python.org/3/howto/logging.html, if that's not good enough please co

Re: Python version problem for rpm

2014-02-17 Thread Mark Lawrence
On 17/02/2014 06:00, anju tiwari wrote: Hi all, I have two version of python 2.4 and 2.7. By default python version is 2.4 . I want to install need to install some rpm which needs python 2.7 interpreter. how can I enable 2.7 interpreter for only those packages which are requiring python 2.7, I

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Steven D'Aprano
On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: > I read about this article: > http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html > > Just wanted to clarify whether CPython already includes these kind of > byte code optimizations? Are all the tempora

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Peter Otten
Laxmikant Chitare wrote: > Hello All, > > I read about this article: > http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/montanaro.html > > Just wanted to clarify whether CPython already includes these kind of byte > code optimizations? Are all the temporary variables removed

Does CPython already has Peephole optimizations?

2014-02-17 Thread Laxmikant Chitare
Hello All, I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/montanaro.html Just wanted to clarify whether CPython already includes these kind of byte code optimizations? Are all the temporary variables removed when byte code is generated? Regards, L

Re: Explanation of list reference

2014-02-17 Thread Steven D'Aprano
On Sun, 16 Feb 2014 22:28:23 -0500, Roy Smith wrote: >> So when does code become data? When it's represented by an object. > > OK, now take somebody who knows lisp and try to explain to him or her > why Python's eval() doesn't mean data is code. Yeah, I know that's > pushing things a bit, but I'