Re: confusing doc: mutable and hashable

2012-04-28 Thread Arnaud Delobelle
(sent from my phone) On Apr 28, 2012 7:36 PM, "Chris Rebert" wrote: > Correct. Pedantically, you can define __hash__() on mutable objects; > it's just not very useful or sensible, so people generally don't. I find it's fine to define __hash__ on mutable objects as long as __eq__ only relies on im

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-28 Thread Cameron Simpson
On 29Apr2012 02:49, Steven D'Aprano wrote: | On Sat, 28 Apr 2012 14:55:42 -0700, Xah Lee wrote: | > Learn Technical Writing from Unix Man in 10 Days | > | > Quote from man apt-get: | > | > remove | > remove is identical to install except that packages are | > removed | > ins

Re: Communication between C++ server and Python app

2012-04-28 Thread Cameron Simpson
On 29Apr2012 11:42, Chris Angelico wrote: | On Sun, Apr 29, 2012 at 10:45 AM, kenk wrote: | > I've got a server process written in C++ running on Unix machine. | > On the same box I'd like to run multiple Python scripts that will | > communicate with this server. | > | > Can you please suggest w

Re: Communication between C++ server and Python app

2012-04-28 Thread Rodrick Brown
What interfaces are available on the server process? Sent from my iPad On Apr 28, 2012, at 8:45 PM, kenk wrote: > Hi, > > I've got a server process written in C++ running on Unix machine. > On the same box I'd like to run multiple Python scripts that will > communicate with this server. > >

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-28 Thread Steven D'Aprano
On Sat, 28 Apr 2012 14:55:42 -0700, Xah Lee wrote: > Learn Technical Writing from Unix Man in 10 Days > > Quote from man apt-get: > > remove > remove is identical to install except that packages are > removed > instead of installed. Do you also expect the documentation to d

Re: confusing doc: mutable and hashable

2012-04-28 Thread Terry Reedy
On 4/28/2012 2:09 PM, laymanzh...@gmail.com wrote: In my understanding, there is no directly relation between mutable and hashable in Python. Any class with __hash__ function is "hashable". According the wiki: http://en.wikipedia.org/wiki/Immutable_object In object-oriented and functional prog

Re: Communication between C++ server and Python app

2012-04-28 Thread Roy Smith
In article <108cb846-6bb9-4600-a984-2fded0c91...@er9g2000vbb.googlegroups.com>, kenk wrote: > Hi, > > I've got a server process written in C++ running on Unix machine. > On the same box I'd like to run multiple Python scripts that will > communicate with this server. > > Can you please sugges

Re: Communication between C++ server and Python app

2012-04-28 Thread Chris Angelico
On Sun, Apr 29, 2012 at 10:45 AM, kenk wrote: > Hi, > > I've got a server process written in C++ running on Unix machine. > On the same box I'd like to run multiple Python scripts that will > communicate with this server. > > Can you please suggest what would be best was to achieve this ? Persona

Communication between C++ server and Python app

2012-04-28 Thread kenk
Hi, I've got a server process written in C++ running on Unix machine. On the same box I'd like to run multiple Python scripts that will communicate with this server. Can you please suggest what would be best was to achieve this ? Kind regards and thanks in advance! M. -- http://mail.python.org/

Re: Getting started with PyGTK [Receiving Error]

2012-04-28 Thread Vincent Vande Vyvre
Le 29/04/12 00:52, Santosh Kumar a écrit : > System Information > > Ubuntu 11.10 > Python 2.7.2 > > Problem > > > I think my Ubuntu has PyGTK and GTK both already installed. But > however when I am importing "gtk" in Python interactive mode then I am > gett

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-28 Thread Andrew Berg
On 4/28/2012 6:45 PM, Temia Eszteri wrote: > Professional? He's boring! I agree. Ranting Rick is much more entertaining (usually). -- CPython 3.2.3/3.3.0a2 | Windows NT 6.1.7601.17790 -- http://mail.python.org/mailman/listinfo/python-list

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-28 Thread Temia Eszteri
>On Sun, Apr 29, 2012 at 8:36 AM, Temia Eszteri wrote: >> And what does this have to do with a multiplatform language like >> Python? :P > >Nothing. Xah Lee is a professional troll. You can save yourself some >trouble by ignoring his posts altogether. > >ChrisA Professional? He's boring! I wanted

Re: confusing doc: mutable and hashable

2012-04-28 Thread MRAB
On 28/04/2012 23:30, Temia Eszteri wrote: Yes, you're right. Being mutable and hashable are orthogonal properties. The implication mutable => non hashable is just a design choice. The reason for such a choice is the following. If a key-element pair K:X is added to a container C and then K

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-28 Thread Chris Angelico
On Sun, Apr 29, 2012 at 8:36 AM, Temia Eszteri wrote: > And what does this have to do with a multiplatform language like > Python? :P Nothing. Xah Lee is a professional troll. You can save yourself some trouble by ignoring his posts altogether. ChrisA -- http://mail.python.org/mailman/listinfo/

Getting started with PyGTK [Receiving Error]

2012-04-28 Thread Santosh Kumar
System Information Ubuntu 11.10 Python 2.7.2 Problem I think my Ubuntu has PyGTK and GTK both already installed. But however when I am importing "gtk" in Python interactive mode then I am getting the following warning: (.:4126): Gtk-WARNING **: Unable to

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-28 Thread Temia Eszteri
And what does this have to do with a multiplatform language like Python? :P ~Temia -- When on earth, do as the earthlings do. -- http://mail.python.org/mailman/listinfo/python-list

Re: confusing doc: mutable and hashable

2012-04-28 Thread Temia Eszteri
>Yes, you're right. Being mutable and hashable are orthogonal properties. >The implication > mutable => non hashable >is just a design choice. > >The reason for such a choice is the following. If a key-element pair K:X >is added to a container C and then K is changed by some external Python >

Learn Technical Writing from Unix Man in 10 Days

2012-04-28 Thread Xah Lee
Learn Technical Writing from Unix Man in 10 Days Quote from man apt-get: remove remove is identical to install except that packages are removed instead of installed. Translation: kicking kicking is identical to kissing except that receiver is kicked inste

Re: confusing doc: mutable and hashable

2012-04-28 Thread Kiuhnm
On 4/28/2012 20:09, laymanzh...@gmail.com wrote: I'm just learning Python. The python doc about mutable and hashable is confusing to me. In my understanding, there is no directly relation between mutable and hashable in Python. Any class with __hash__ function is "hashable". According the wik

Re: syntax for code blocks

2012-04-28 Thread Ethan Furman
Kiuhnm wrote: I'd like to change the syntax of my module 'codeblocks' to make it more pythonic. Current Syntax: with res << func(arg1) << 'x, y': print(x, y) with res << func(arg1) << block_name << 'x, y': print(x, y) New Syntax: with res == func(arg1) .taking_bl

From the crest of Olivet...

2012-04-28 Thread E Bmums
"From the crest of Olivet, Jesus looked upon Jerusalem. Fair and peaceful was the scene spread out before Him. It was the season of the Passover, and from all lands the children of Jacob had gathered there to celebrate the great national festival. In the midst of gardens and vineyards, and gre

Re: CPython thread starvation

2012-04-28 Thread Paul Rubin
Roy Smith writes: > I agree that application-level name cacheing is "wrong", but sometimes > doing it the wrong way just makes sense. I could whip up a simple > cacheing wrapper around getaddrinfo() in 5 minutes. Depending on the > environment (both technology and bureaucracy), getting a cach

Re: (3.2) Overload print() using the C API?

2012-04-28 Thread Stefan Behnel
Peter Faulks, 27.04.2012 22:31: > On 27/04/2012 6:55 PM, Stefan Behnel wrote: >> Peter Faulks, 27.04.2012 10:36: >>> On 27/04/2012 5:15 PM, Stefan Behnel wrote: Peter Faulks, 26.04.2012 19:57: > I want to extend an embedded interpreter so that calls to print() are > automagically sent

Re: confusing doc: mutable and hashable

2012-04-28 Thread Chris Rebert
On Sat, Apr 28, 2012 at 11:09 AM, wrote: > I'm just learning Python. The python doc about mutable and hashable is > confusing to me. > > In my understanding, there is no directly relation between mutable and > hashable in Python. Any class with __hash__ function is "hashable". > > According the

Re: confusing doc: mutable and hashable

2012-04-28 Thread mwilson
laymanzh...@gmail.com wrote: > I'm just learning Python. The python doc about mutable and hashable is > confusing to me. > > In my understanding, there is no directly relation between mutable and > hashable in Python. Any class with __hash__ function is "hashable". > > According the wiki: http:/

confusing doc: mutable and hashable

2012-04-28 Thread laymanzheng
I'm just learning Python. The python doc about mutable and hashable is confusing to me. In my understanding, there is no directly relation between mutable and hashable in Python. Any class with __hash__ function is "hashable". According the wiki: http://en.wikipedia.org/wiki/Immutable_object

Re: Python id() does not return an address [was Re: why () is () and [] is [] work in other way?]

2012-04-28 Thread OKB (not okblacke)
Adam Skutt wrote: >> You can't treat id() as an address. Did you miss my post when I >> demonstrated that Jython returns IDs generated on demand, starting >> from 1? In general, there is *no way even in principle* to go from >> a Python ID to the memory location (address) of the object with >> tha

Re: beautiful bitch accepts dwarf

2012-04-28 Thread jimmy970
http://python.6.n6.nabble.com/file/n4936643/op4.jpg -- View this message in context: http://python.6.n6.nabble.com/AMPUTEE-INCEST-MIDGET-2012-tp4708963p4936643.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: CPython thread starvation

2012-04-28 Thread Chris Angelico
On Sun, Apr 29, 2012 at 12:27 AM, Danyel Lawson wrote: > I'm glad I thought of it. ;) But the trick is to use port 5353 and set > a really short timeout on responses in the config for the DNS cache. I don't think false timeouts are any better than true ones, if you actually know the true ones. Bu

Re: CPython thread starvation

2012-04-28 Thread Danyel Lawson
I'm glad I thought of it. ;) But the trick is to use port 5353 and set a really short timeout on responses in the config for the DNS cache. On Sat, Apr 28, 2012 at 10:15 AM, Chris Angelico wrote: > On Sat, Apr 28, 2012 at 11:46 PM, Danyel Lawson > wrote: >> The DNS lookup is one of those things

Re: why () is () and [] is [] work in other way?

2012-04-28 Thread Adam Skutt
On Apr 28, 7:26 am, Kiuhnm wrote: > On 4/27/2012 19:15, Adam Skutt wrote: > > On Apr 27, 11:01 am, Kiuhnm  wrote: > >> The abstraction is this: > >> - There are primitives and objects. > >> - Primitives are not objects. The converse is also true. > >> - Primitives can become objects (boxing). > >>

Re: CPython thread starvation

2012-04-28 Thread Chris Angelico
On Sat, Apr 28, 2012 at 11:46 PM, Danyel Lawson wrote: > The DNS lookup is one of those things that may make sense to run as a > separate daemon process that listens on a socket. Yeah, it does. One that listens on port 53, TCP and UDP, perhaps. :) You've just recommended installing a separate ca

Re: int object

2012-04-28 Thread Emile van Sebille
On 4/27/2012 11:42 PM Debashish Saha said... 44 sph_yn_P=(l*sph_yn(l,K*R)/(K*R))-sph_yn(l,K*R) Here you're clearly multiplying by R... ---> 45 Beta_l=l-(K_P*R(sph_jv(l+1,K_P*R))/(sph_jv(l,K_P*R))) ... and here you've got R(...) which is attempting to call R() which isn't def

Re: CPython thread starvation

2012-04-28 Thread Danyel Lawson
Sprinkle time.sleep(0) liberally throughout your code where you think natural processing breaks should be. Even in while loops. It's lame but is the only way to make Python multithreading task switch fairly. Your compute intensive tasks need a time.sleep(0) in their loops. This prevents starvation

Re: CPython thread starvation

2012-04-28 Thread Roy Smith
In article <7xy5pgqwto@ruckus.brouhaha.com>, Paul Rubin wrote: > John Nagle writes: > >I may do that to prevent the stall. But the real problem was all > > those DNS requests. Parallizing them wouldn't help much when it took > > hours to grind through them all. > > True dat. But bui

Re: why () is () and [] is [] work in other way?

2012-04-28 Thread Kiuhnm
On 4/27/2012 17:39, Adam Skutt wrote: On Apr 27, 8:07 am, Kiuhnm wrote: Useful... maybe, conceptually sound... no. Conceptually, NaN is the class of all elements which are not numbers, therefore NaN = NaN. NaN isn't really the class of all elements which aren't numbers. NaN is the result of

Re: why () is () and [] is [] work in other way?

2012-04-28 Thread Chris Angelico
On Sat, Apr 28, 2012 at 9:26 PM, Kiuhnm wrote: > Your problem is that you think that copy semantics requires real copying. I > really don't see any technical difficulty in virtualizing the all thing. "Copy semantics" without "real copying" is an optimization that a program should never need to be

Re: solutions books

2012-04-28 Thread ali deli
Hi, I'am a college physics student. If you have the following document " SOLUTIONS MANUAL TO FUNDAMENTALS OF ENGINEERING ELECTROMAGNETICS, by DAVID CHENG ", Could you please send me the document? -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-28 Thread Kiuhnm
On 4/27/2012 19:15, Adam Skutt wrote: On Apr 27, 11:01 am, Kiuhnm wrote: On 4/27/2012 1:57, Adam Skutt wrote: On Apr 26, 6:34 pm, Kiuhnmwrote: If you understand that your 'a' is not really an object but a reference to it, everything becomes clear and you see that '==' always do the same

Re: syntax for code blocks

2012-04-28 Thread Kiuhnm
On 4/27/2012 18:07, Steven D'Aprano wrote: > On Fri, 27 Apr 2012 17:03:19 +0200, Kiuhnm wrote: > >> On 4/27/2012 16:09, Steven D'Aprano wrote: >>> On Fri, 27 Apr 2012 13:24:35 +0200, Kiuhnm wrote: >>> I'd like to change the syntax of my module 'codeblocks' to make it more pythonic.