Re: Python Developers with 5 years of experience

2011-05-04 Thread km
probably it is good to post jobs in python-list itself rather than posting it on someother site. Many mailing lists do that. It gives a feel of what jobs we come across for the Python developers. KM On Thu, May 5, 2011 at 3:16 AM, Ben Finney wrote: > "Jerome jjcpl.rpo" writes: > > > One of our c

Re: Python Developers with 5 years of experience

2011-05-04 Thread Paul Rubin
Ben Finney writes: > Please do not solicit for jobs here. Instead, the Python Job Board > http://www.python.org/community/jobs/> is intended for that purpose. Wow, there's quite a lot of listings there. There had been only a few last time I looked. But, most of them seem to involve Django. --

Re: Hooking into Python's memory management

2011-05-04 Thread Daniel Neilson
Thanks for the feedback, everyone. I spent some time today playing around with the gc module, and came to the same conclusion that many of you have as well. for o in gc.get_objects(): print(o) was sufficient to convince me that I didn't want to go that route. Writing a simple mem

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Dennis Lee Bieber wrote: > We do not consider passing a pointer as*by value* because its an > address; by definition, that is pass-by-reference. We are not passing To most of the world, pass-by-reference means the COMPILER, not the PROGRAMMER is obtaining and passing the address, and

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Thu, 05 May 2011 15:48:51 +1200, Gregory Ewing wrote: : No, it's not. With call-by-name, the caller passes a : small function (known as a "thunk") that calculates the : address of the parameter. Every time the callee needs to : refer to the parameter, it evaluates this function. Well, ca

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Tim Roberts wrote: The fact that the parameter "a" in BumpMe happens to be an address is completely irrelevent to the definition of the parameter passing mechanism. C has pass-by-value, exclusively. End of story. Yeah, Tim, I know... but that's my entire point in a nut-shell... whether the l

Re: What other languages use the same data model as Python?

2011-05-04 Thread John Nagle
On 5/4/2011 5:46 PM, harrismh777 wrote: John Nagle wrote: Arguably, Python should not allow "is" or "id()" on immutable objects. The programmer shouldn't be able to tell when the system decides to optimize an immutable. "is" is more of a problem than "id()"; "id()" is an explicit peek into an i

Re: Hooking into Python's memory management

2011-05-04 Thread scattered
On May 4, 12:51 pm, Daniel Neilson wrote: > Hello, >   I'm hoping that there will be someone here with sufficient expertise > to answer a question on Python 3 for me. > >   I work in the Computer Science department at a large Canadian > University. We are currently doing a feasibility analysis for

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Mark Hammond wrote: What about Python, where passing an integer to a function passes a pointer to an int object, but that function is able to change the value of the variable locally without changing the passed object (indeed, it is impossible to change the passed integer)? So given the definiti

Re: What other languages use the same data model as Python?

2011-05-04 Thread Gregory Ewing
Hans Georg Schaathun wrote: Is transmission by name the same as call by object? No, it's not. With call-by-name, the caller passes a small function (known as a "thunk") that calculates the address of the parameter. Every time the callee needs to refer to the parameter, it evaluates this functio

Re: What other languages use the same data model as Python?

2011-05-04 Thread Tim Roberts
harrismh777 wrote: > >If I call a function in C, and pass-by-value, the data's 'value' is >placed on the stack in a stack-frame, as a 'value' parm... its a copy of >the actual data in memory. > >If I call a function in C, and pass-by-reference, the data's 'address' >is placed on the stack in a

Re: Hooking into Python's memory management

2011-05-04 Thread Gregory Ewing
Daniel Neilson wrote: 1) Maintain a list of object id()'s for objects that have been created. Ideally, this list would also contain the file & line number where the object was created. 2) Provide a "deallocate" function that will remove a given object's id() from the list from (1). 3) P

Re: What other languages use the same data model as Python?

2011-05-04 Thread Chris Angelico
On Thu, May 5, 2011 at 7:43 AM, Ben Finney wrote: > * that the paper tag is tied to only one object > > * that a paper tag tied to no object is rather useless > > * that many paper tags can be tied to the same object I disagree minorly; a tag tied to no object is quite useful in some circumstance

Re: Fibonacci series recursion error

2011-05-04 Thread Gregory Ewing
Chris Angelico wrote: There's definitely something attractive about that letter. Lots of programming languages' names start with P. Including one I invented some years ago, that (in the spirit of C and its derivatives) was called simply "P". (I was playing around with Sun's NeWS window server

Re: importing class objects from a pickled file

2011-05-04 Thread Gregory Ewing
Catherine Moroney wrote: I am having some problems reading the object back out, as I get complaints about "unable to import module X". The only way I have found around it is to run the read-file code out of the same directory that contains the X.py file Even when I put statements into the c

Re: Today's fun and educational Python recipe

2011-05-04 Thread Chris Angelico
On Thu, May 5, 2011 at 5:02 AM, Irmen de Jong wrote: > I think that often, the cleverness of people is inversely proportional to > the amount of CPU power and RAM that they have in their computer. As Mark Rosewater is fond of saying, restrictions breed creativity. Lack of computational resources

Re: What other languages use the same data model as Python?

2011-05-04 Thread Mark Hammond
On 5/05/2011 11:11 AM, harrismh777 wrote: The "pass by value" and "pass by reference" parameter passing mechanisms are pretty well defined, and C uses "pass by value". Yeah, that's kind-a funny, cause I'm one of the guys (old farts) that helped define them Cool - please tell us more abo

Re: Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
On May 4, 5:26 pm, Terry Reedy wrote: > The test would be more convincing to many with 10 other geographic > names (hard to come by, I know), or other english names or words or even > with longer random strings that matched the lengths of the state names. > But an average of 5/10 false pos

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Grant Edwards wrote: The "pass by value" and "pass by reference" parameter passing mechanisms are pretty well defined, and C uses "pass by value". Yeah, that's kind-a funny, cause I'm one of the guys (old farts) that helped define them The problem you're having here is that you're think

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Ian Kelly wrote: However, I hope we can all agree that pass-by-pointer shares certain features with both pass-by-value and pass-by-reference, and there are perfectly reasonable arguments for lumping it in either category, yes? Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
John Nagle wrote: Arguably, Python should not allow "is" or "id()" on immutable objects. The programmer shouldn't be able to tell when the system decides to optimize an immutable. "is" is more of a problem than "id()"; "id()" is an explicit peek into an implementation detail. Yes, yes, ye

Re: [OT]: PiCloud - really cool!

2011-05-04 Thread geremy condra
On Wed, May 4, 2011 at 5:29 PM, James Mills wrote: > On Thu, May 5, 2011 at 10:19 AM, geremy condra wrote: >> I was the poster across from them at PyCon two years back. Pretty fun >> to play with, although last I checked it was hard to do true HPC on >> it. > > Why's that ? And what is true HPC (

Re: [OT]: PiCloud - really cool!

2011-05-04 Thread James Mills
On Thu, May 5, 2011 at 10:19 AM, geremy condra wrote: > I was the poster across from them at PyCon two years back. Pretty fun > to play with, although last I checked it was hard to do true HPC on > it. Why's that ? And what is true HPC (High Performance Computing) anyway ? I find the API provided

Re: Today's fun and educational Python recipe

2011-05-04 Thread Terry Reedy
On 5/4/2011 5:39 PM, Raymond Hettinger wrote: The 512 bits in h are progressively eaten-up between iterations. So each pass yields a different (array index, bit_mask) pair. Yeh, obvious now that I see it. It's easy to use the interactive prompt to show that different probes are produced on

Re: [OT]: PiCloud - really cool!

2011-05-04 Thread geremy condra
On Wed, May 4, 2011 at 5:13 PM, James Mills wrote: > If anyone hasn't seen this yet, I encourage you to! > (I stumbled upon it with some random thoughts and Gooogling) > > http://www.picloud.com/ > > Here's a quick test I wrote up that works locally using the simulator > and live (I did run it liv

[OT]: PiCloud - really cool!

2011-05-04 Thread James Mills
If anyone hasn't seen this yet, I encourage you to! (I stumbled upon it with some random thoughts and Gooogling) http://www.picloud.com/ Here's a quick test I wrote up that works locally using the simulator and live (I did run it live): #!/usr/bin/env python import cloud def fib(n): a, b,

Re: Today's fun and educational Python recipe

2011-05-04 Thread Ben Finney
Grant Edwards writes: > On 2011-05-04, Irmen de Jong wrote: > > I think that often, the cleverness of people is inversely > > proportional to the amount of CPU power and RAM that they have in > > their computer. > > True. > > Unfortunately the difficulty in debugging and maintaining code is > of

Re: What other languages use the same data model as Python?

2011-05-04 Thread Ian Kelly
On Wed, May 4, 2011 at 3:35 PM, harrismh777 wrote: > Grant Edwards wrote: >>> >>> We do not consider passing a pointer as*by value*  because its an >>> >  address; by definition, that is pass-by-reference. >> >> No, it isn't.  It's pass by value.  The fact that you are passing a >> value that is a

Re: Basic interaction with another program

2011-05-04 Thread ETP
Thanks everyone. I actually ran the program in question using Wine compatibility layer and it seemed to work fine. Terry, that looks like it could be useful, too. I'll give it a shot and let you guys know how it works. -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding Python's library as zip file

2011-05-04 Thread Ian Kelly
On Wed, May 4, 2011 at 3:09 PM, Wojtek Mamrak wrote: > Hello, > > I spent a lot of time googling for a solution of this problem, with no > result. > > I have a C++ application, in which I would like to embed Python interpreter. > I don't want to rely on an interpreter being installed on user machi

Re: What other languages use the same data model as Python?

2011-05-04 Thread Grant Edwards
On 2011-05-04, harrismh777 wrote: > Grant Edwards wrote: >>> We do not consider passing a pointer as*by value* because its an >>> > address; by definition, that is pass-by-reference. >> No, it isn't. It's pass by value. The fact that you are passing a >> value that is a pointer to another valu

Re: Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
On May 4, 12:27 pm, Paul Rubin wrote: > Raymond Hettinger writes: > > Here's a 22-line beauty for a classic and amazing algorithm: > >http://bit.ly/bloom_filter > > The use of pickle to serialize the keys is a little bit suspicious if > there might be a reason to dump the filter to disk and re-us

Re: What other languages use the same data model as Python?

2011-05-04 Thread John Nagle
On 5/4/2011 3:51 AM, Steven D'Aprano wrote: On Wed, 04 May 2011 02:56:28 -0700, Devin Jeanpierre wrote: Python is pass-by-value in a meaningful sense, it's just that by saying that we say that the values being passed are references/pointers. This is maybe one level of abstraction below what's i

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Hans Georg Schaathun wrote: That does not in any way impugn C..;. : quite the contrary, given enough time, C is better suited for modeling : on a von Neumann processor, period. What has that got to do with abstraction? Everything, really. Folks seem to think that because they are doing abs

Re: Python Developers with 5 years of experience

2011-05-04 Thread Ben Finney
"Jerome jjcpl.rpo" writes: > One of our client in New Jersey is looking for Python Developers with > 5 years of experience. If you have any resumes please send it across. Please do not solicit for jobs here. Instead, the Python Job Board http://www.python.org/community/jobs/> is intended for tha

Re: What other languages use the same data model as Python?

2011-05-04 Thread Ben Finney
Steven D'Aprano writes: > Given the following statement of Python code: > > >>> x = "spam" > > what is the value of the variable x? Mu (無). ‘x’ is a name. Names are bound to values. Talk of “variable” only confuses the issue because of the baggage carried with that term. Yes, the Python docume

Re: Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
On May 4, 12:42 pm, Terry Reedy wrote: > On 5/4/2011 2:17 PM, Raymond Hettinger wrote: > > > Here's a 22-line beauty for a classic and amazing algorithm: > >http://bit.ly/bloom_filter > > > The wiki article on the algorithm is brief and well-written: > >http://en.wikipedia.org/wiki/Bloom_filter >

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Grant Edwards wrote: We do not consider passing a pointer as*by value* because its an > address; by definition, that is pass-by-reference. No, it isn't. It's pass by value. The fact that you are passing a value that is a pointer to another value is not relevent. @ Edwards, &Schaathun You

Embedding Python's library as zip file

2011-05-04 Thread Wojtek Mamrak
Hello, I spent a lot of time googling for a solution of this problem, with no result. I have a C++ application, in which I would like to embed Python interpreter. I don't want to rely on an interpreter being installed on user machine, instead I would like to distribute all the necessary files wit

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Wed, 04 May 2011 14:58:38 -0500, harrismh777 wrote: : True enough. If I used Jython, I would want to take a look at those : sources... as well as the Java sources... which were wrtten in, um, C. And then, suddenly, you'll be developing code which fails on CPython instead of code whi

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Wed, 04 May 2011 14:33:34 -0500, harrismh777 wrote: : Hans Georg Schaathun wrote: : > In C it is pass by value, as the pointer : > is explicit and do whatever you want with the pointer value. : : You clearly are not a C programmer. I am not really a programmer period. I am many things an

Re: Basic interaction with another program

2011-05-04 Thread Dan Stromberg
On Wed, May 4, 2011 at 9:34 AM, ETP wrote: > I have a dos program (run in a window) that I would like to control > with a script. It needs only text input. > > It will then wait for a file to be created, rename the file, then > loop. Simple. > Or not. > I'd like to run this on Lucid Puppy Li

Re: What other languages use the same data model as Python?

2011-05-04 Thread Grant Edwards
On 2011-05-04, harrismh777 wrote: > Hans Georg Schaathun wrote: >> In C it is pass by value, as the pointer is explicit and do whatever >> you want with the pointer value. > > You clearly are not a C programmer. > > Most of my C data abstractions use dual circular linked lists of > pointers to s

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Wed, 04 May 2011 14:22:38 -0500, harrismh777 wrote: : That statement is untrue; evidenced by the very fact the CPython's : complex and abstract data modeling has been very suitably handled by C. That's an implementation. Not modelling. : You cannot possibly mean what you have a

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Benjamin Kaplan wrote: CPython is implemented in C because that's the language chosen. Python is also implemented in Java, C#, Python, and several other languages. True enough. If I used Jython, I would want to take a look at those sources... as well as the Java sources... which were wrtte

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Devin Jeanpierre wrote: "How was the date last night?" > "Oh, it was marvelous! He presented me with a single red stink-weed, and > then we went to a disgusting little restaurant. I had the swill." Please don't argue with me in this manner. D'Aprano takes a little getting used to. He

Re: What other languages use the same data model as Python?

2011-05-04 Thread Benjamin Kaplan
On Wed, May 4, 2011 at 3:22 PM, harrismh777 wrote: > Hans Georg Schaathun wrote: >> >> It only works by assuming >> knowledge of C, which is language which has proved unsuitable for >> complex and abstract data modelling. > >   That statement is untrue; evidenced by the very fact the CPython's com

Re: Today's fun and educational Python recipe

2011-05-04 Thread Terry Reedy
On 5/4/2011 2:17 PM, Raymond Hettinger wrote: Here's a 22-line beauty for a classic and amazing algorithm: http://bit.ly/bloom_filter The wiki article on the algorithm is brief and well-written: http://en.wikipedia.org/wiki/Bloom_filter As I understand the article, the array of num_bits should

Re: Today's fun and educational Python recipe

2011-05-04 Thread Irmen de Jong
On 04-05-11 21:13, Raymond Hettinger wrote: It turns out that people in the 1970's were pretty smart :-) I think that often, the cleverness of people is inversely proportional to the amount of CPU power and RAM that they have in their computer. The Google guys have plenty of CPU power *and* p

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Hans Georg Schaathun wrote: In C it is pass by value, as the pointer is explicit and do whatever you want with the pointer value. You clearly are not a C programmer. Most of my C data abstractions use dual circular linked lists of pointers to structures of pointers. *All* of that is only ever

Re: Today's fun and educational Python recipe

2011-05-04 Thread Paul Rubin
Raymond Hettinger writes: > Here's a 22-line beauty for a classic and amazing algorithm: > http://bit.ly/bloom_filter The use of pickle to serialize the keys is a little bit suspicious if there might be a reason to dump the filter to disk and re-use it in another run of the program. Pickle repre

Re: What other languages use the same data model as Python?

2011-05-04 Thread harrismh777
Hans Georg Schaathun wrote: It only works by assuming knowledge of C, which is language which has proved unsuitable for complex and abstract data modelling. That statement is untrue; evidenced by the very fact the CPython's complex and abstract data modeling has been very suitably handled b

Re: Today's fun and educational Python recipe

2011-05-04 Thread Grant Edwards
On 2011-05-04, Irmen de Jong wrote: > On 04-05-11 20:17, Raymond Hettinger wrote: >> Here's a 22-line beauty for a classic and amazing algorithm: >> http://bit.ly/bloom_filter >> >> The wiki article on the algorithm is brief and well-written: >> http://en.wikipedia.org/wiki/Bloom_filter >> >> It t

Re: Basic interaction with another program

2011-05-04 Thread Terry Reedy
On 5/4/2011 12:34 PM, ETP wrote: I have a dos program (run in a window) that I would like to control with a script. Look at the subprocess module. You may have to (and be able to) have it start up the window program with the dos program as an argument. It needs only text input. For exampl

Re: Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
> > It turns out that people in the 1970's were pretty smart :-) > > I think that often, the cleverness of people is inversely proportional > to the amount of CPU power and RAM that they have in their computer. The Google guys have plenty of CPU power *and* plenty of cleverness :-) According to t

Re: Today's fun and educational Python recipe

2011-05-04 Thread Irmen de Jong
On 04-05-11 20:17, Raymond Hettinger wrote: Here's a 22-line beauty for a classic and amazing algorithm: http://bit.ly/bloom_filter The wiki article on the algorithm is brief and well-written: http://en.wikipedia.org/wiki/Bloom_filter It turns out that people in the 1970's were pretty smart :-)

Re: Hooking into Python's memory management

2011-05-04 Thread Terry Reedy
On 5/4/2011 12:51 PM, Daniel Neilson wrote: Hello, I'm hoping that there will be someone here with sufficient expertise to answer a question on Python 3 for me. I work in the Computer Science department at a large Canadian University. We are currently doing a feasibility analysis for switching

Re: [ann] pyjamas 0.8alpha1 release

2011-05-04 Thread Terry Reedy
On 5/4/2011 10:06 AM, Luke Kenneth Casson Leighton wrote: after a long delay the pyjamas project - http://pyjs.org - has begun the 0.8 series of releases, beginning with alpha1: https://sourceforge.net/projects/pyjamas/files/pyjamas/0.8/ pyjamas is a suite of projects, including a python-to-jav

Re: Pickling extension types

2011-05-04 Thread Robert Kern
On 5/4/11 10:45 AM, Stefan Kuzminski wrote: I got this to work by returning from reduce just the args that the __init__ of the type being pickled requires ( rather than the 5 length tuple described in the pickling docs ), I am not going to argue with it though.. Let's take a step back. The docu

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2011-05-04 Thread Ethan Furman
Raymond Hettinger wrote: I'm writing-up more guidance on how to use super() and would like to point at some real-world Python examples of cooperative multiple inheritance. Don't know if you are still looking for examples, but I recently came across a thread in Python-Dev which had an example u

Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
Here's a 22-line beauty for a classic and amazing algorithm: http://bit.ly/bloom_filter The wiki article on the algorithm is brief and well-written: http://en.wikipedia.org/wiki/Bloom_filter It turns out that people in the 1970's were pretty smart :-) Raymond --- follow my other python tip

Re: Basic interaction with another program

2011-05-04 Thread Grant Edwards
On 2011-05-04, Ian Kelly wrote: > On Wed, May 4, 2011 at 10:52 AM, Grant Edwards > wrote: >> On 2011-05-04, Matty Sarro wrote: >>> On Wed, May 4, 2011 at 12:34 PM, ETP wrote: I have a dos program (run in a window) that I would like to control with a script. >> >>> Look into the pexpe

Re: Development tools and practices for Pythonistas

2011-05-04 Thread Anssi Saari
rusi writes: >> I actually use rcs in Windows. Needs a little setup, but works great, >> from Emacs VC-mode too. > > Where do you get it? > [What google is showing seems to be about 10-15 years old] As far as I know, RCS hasn't been updated since 5.7 which is about 10 years old now. Linux distri

Re: Hooking into Python's memory management

2011-05-04 Thread Dan Stromberg
Sturla had some great comments; I'll add, in no particular order: 1) You could use the ctypes module to call the real malloc and free from Python. 2) Yes, a Python "C extension module" can do explicit memory allocation. 3) Cython provides a language that is a hybrid of Python and C. It might be n

Re: A very minute correction on PDF

2011-05-04 Thread Terry Reedy
On 5/4/2011 3:45 AM, Mehta, Pratik wrote: For tutorialPython.pdf Page 17 of the ebook (i.e. page 23 of pdf) under topic *3.2 First Steps towards programming* Under while loop, there should be a “,” after print b Print b, (a comma after ‘b’ is missing) [You should mention versions when posting

Python Developers with 5 years of experience

2011-05-04 Thread Jerome jjcpl.rpo
send resumes to jer...@jjcpl.net One of our client in New Jersey is looking for Python Developers with 5 years of experience. If you have any resumes please send it across. -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic interaction with another program

2011-05-04 Thread Ian Kelly
On Wed, May 4, 2011 at 10:52 AM, Grant Edwards wrote: > On 2011-05-04, Matty Sarro wrote: >> On Wed, May 4, 2011 at 12:34 PM, ETP wrote: >>> I have a dos program (run in a window) that I would like to control >>> with a script. > >> Look into the pexpect library, it'll make this easy as punch. >

Re: What other languages use the same data model as Python?

2011-05-04 Thread sturlamolden
On May 4, 7:15 pm, Benjamin Kaplan wrote: > You missed a word in the sentence. > > "If you can see this, you DON'T have call-by-value" Indeed I did, sorry! Then we agree :) Sturla -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Thu, 5 May 2011 00:20:34 +1000, Chris Angelico wrote: : Sometimes, to explain Python, you need to dig down to the underlying : hardware - even deeper than C, if you like. Sometimes you may need to narrow down the scope and explain a particular implementation of python with its hardware, OS

newbie needs help with cookielib

2011-05-04 Thread Sells, Fred
I'm using Python 2.4 and 2.7 for different apps. I'm happy with a solution for either one. I've got to talk to a url that uses a session cookie. I only need to set this when I'm developing/debugging so I don't need a robust production solution and I'm somewhat confused by the docs on cookielib.

Re: What other languages use the same data model as Python?

2011-05-04 Thread Benjamin Kaplan
On Wed, May 4, 2011 at 12:40 PM, sturlamolden wrote: > > On May 4, 5:40 pm, Michael Torrie wrote: > > > Which is exactly what the code showed.  The first one isn't a mistake. > > You just read it wrong. > > No, I read "call-by-value" but it does not make a copy. Call-by-value > dictates a deep co

Re: Hooking into Python's memory management

2011-05-04 Thread sturlamolden
On May 4, 6:51 pm, Daniel Neilson wrote: >   In either case, if such a module is possible, any pointers you could > provide regarding how to implement such a module would be appreciated. The gc module will hook into the garbage collector. The del statement will remove an object from the curren

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Wed, 4 May 2011 09:18:56 -0700 (PDT), Devin Jeanpierre wrote: : I'm a bit uncomfortable with the vibe here. It's one thing for me to : self-deprecatingly suggest I'm brainwashed (with a smile), and another : for you to agree in complete seriousness. I am sorry. It was not meant to be an

Re: Basic interaction with another program

2011-05-04 Thread Grant Edwards
On 2011-05-04, Matty Sarro wrote: > On Wed, May 4, 2011 at 12:34 PM, ETP wrote: >> I have a dos program (run in a window) that I would like to control >> with a script. > Look into the pexpect library, it'll make this easy as punch. I don't think pexpect is going to do the OP much good. Quot

Hooking into Python's memory management

2011-05-04 Thread Daniel Neilson
Hello, I'm hoping that there will be someone here with sufficient expertise to answer a question on Python 3 for me. I work in the Computer Science department at a large Canadian University. We are currently doing a feasibility analysis for switching to using Python in our first year major

Re: What other languages use the same data model as Python?

2011-05-04 Thread sturlamolden
On May 4, 5:40 pm, Michael Torrie wrote: > Which is exactly what the code showed.  The first one isn't a mistake. > You just read it wrong. No, I read "call-by-value" but it does not make a copy. Call-by-value dictates a deep copy or copy-on-write. Python does neither. Python pass a handle to th

Re: Basic interaction with another program

2011-05-04 Thread Matty Sarro
Look into the pexpect library, it'll make this easy as punch. http://www.noah.org/wiki/pexpect On Wed, May 4, 2011 at 12:34 PM, ETP wrote: > I have a dos program (run in a window) that I would like to control > with a script.  It needs only text input.  For example, I only need to > tell it: > >

Basic interaction with another program

2011-05-04 Thread ETP
I have a dos program (run in a window) that I would like to control with a script. It needs only text input. For example, I only need to tell it: L u 100 u It will then wait for a file to be created, rename the file, then loop. Simple. I'd like to run this on Lucid Puppy Linux as it will be

Re: What other languages use the same data model as Python?

2011-05-04 Thread Devin Jeanpierre
On May 4, 9:44 am, Hans Georg Schaathun wrote: > : The only twist is that you never get to dereference > : pointers in Python, but you can in C. Not much of a twist if you ask > : me, but then again, I've been thinking in thismodelfor years. Maybe > : I'm brainwashed. :) > > You a

Re: Handling the log in BaseHTTPServer

2011-05-04 Thread LehH Sdsk8
On 4 maio, 12:55, Tapi wrote: > Hi, > > You may create a subclass of (or Mixin for) BaseHTTPRequestHandler to > override its log_message() method. > Here's a really simple example ; it's perfectible, but it should show > you the way : > > class MyLoggingHTTPRequestHandler(BaseHTTPRequestHandler):

Re: What other languages use the same data model as Python?

2011-05-04 Thread Michael Torrie
On 05/04/2011 08:44 AM, sturlamolden wrote: > On May 3, 6:33 pm, Mel wrote: > >> def identify_call (a_list): >> a_list[0] = "If you can see this, you don't have call-by-value" >> a_list = ["If you can see this, you have call-by-reference"] > > > The first one is a mistake. If it were pass-b

Re: Handling the log in BaseHTTPServer

2011-05-04 Thread Tapi
Hi, You may create a subclass of (or Mixin for) BaseHTTPRequestHandler to override its log_message() method. Here's a really simple example ; it's perfectible, but it should show you the way : class MyLoggingHTTPRequestHandler(BaseHTTPRequestHandler): def log_message(self, format, *args):

Re: [ann] pyjamas 0.8alpha1 release

2011-05-04 Thread Luke Kenneth Casson Leighton
On Wed, May 4, 2011 at 3:06 PM, Luke Kenneth Casson Leighton wrote: > after a long delay the pyjamas project - http://pyjs.org - has begun the > 0.8 series of releases, beginning with alpha1: > > https://sourceforge.net/projects/pyjamas/files/pyjamas/0.8/ > > pyjamas is a suite of projects, inclu

Re: Pickling extension types

2011-05-04 Thread Stefan Kuzminski
I got this to work by returning from reduce just the args that the __init__ of the type being pickled requires ( rather than the 5 length tuple described in the pickling docs ), I am not going to argue with it though.. thank you *very* much for the help! S On Wed, May 4, 2011 at 11:06 AM, Robert

Re: Pickling extension types

2011-05-04 Thread Robert Kern
On 5/3/11 9:28 PM, Stefan Kuzminski wrote: closer I think 1) I changed tp_name to be 'observation.MV' ( module is named observation.c ) and now I get a new error.. PicklingError: Can't pickle : import of module observation failed 2) here is the init function, sorry I did not include it in the

Re: What other languages use the same data model as Python?

2011-05-04 Thread sturlamolden
On May 3, 6:33 pm, Mel wrote: > def identify_call (a_list): > a_list[0] = "If you can see this, you don't have call-by-value" > a_list = ["If you can see this, you have call-by-reference"] The first one is a mistake. If it were pass-by-value, it would assign the string to a list unseen by t

Re: What other languages use the same data model as Python?

2011-05-04 Thread sturlamolden
On May 3, 3:50 pm, Hrvoje Niksic wrote: > I would say that, considering currently most popular languages and > platforms, Python's data model is in the majority.  It is only the > people coming from a C++ background that tend to be confused by it. In C++, one will ususally put class variables (o

Re: What other languages use the same data model as Python?

2011-05-04 Thread Chris Angelico
On Wed, May 4, 2011 at 11:44 PM, Hans Georg Schaathun wrote: > It is contorted and implementation-level because it is one level below > the abstraction assumed by the language.  It only works by assuming > knowledge of C, which is language which has proved unsuitable for > complex and abstract da

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Wed, 4 May 2011 06:12:14 -0700 (PDT), Devin Jeanpierre wrote: : I don't think of "pass-by-value" involving references as being an : implementation-level thing. It's a way of thinking about Python's : behavior: a model. (...) : It isn't particularly contorted. I learned Python this way and

[ann] pyjamas 0.8alpha1 release

2011-05-04 Thread Luke Kenneth Casson Leighton
after a long delay the pyjamas project - http://pyjs.org - has begun the 0.8 series of releases, beginning with alpha1: https://sourceforge.net/projects/pyjamas/files/pyjamas/0.8/ pyjamas is a suite of projects, including a python-to-javascript compiler with two modes of operation (roughly classi

Re: What other languages use the same data model as Python?

2011-05-04 Thread Devin Jeanpierre
On May 4, 6:56 am, Hans Georg Schaathun wrote: > On Wed, 4 May 2011 02:56:28 -0700 (PDT), Devin Jeanpierre  > wrote: > > :  Eh, that example doesn't say what you think it does. It has the same > :  behavior in C:http://ideone.com/Fq09N. Python is pass-by-value in a > :  meaningful sense, it's ju

Re: What other languages use the same data model as Python?

2011-05-04 Thread Devin Jeanpierre
On May 4, 6:51 am, Steven D'Aprano wrote: > On Wed, 04 May 2011 02:56:28 -0700, Devin Jeanpierre wrote: > > Python is pass-by-value in a > > meaningful sense, it's just that by saying that we say that the values > > being passed are references/pointers. This is maybe one level of > > abstraction b

Re: vertical ordering of functions

2011-05-04 Thread John Roth
On May 3, 4:08 pm, Jabba Laci wrote: > Hi, > > I'm just reading Robert M. Martin's book entitled "Clean Code". In Ch. > 5 he says that a function that is called should be below a function > that does the calling. This creates a nice flow down from top to > bottom. > However, when I write a Python

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Wed, 4 May 2011 02:56:28 -0700 (PDT), Devin Jeanpierre wrote: : Eh, that example doesn't say what you think it does. It has the same : behavior in C: http://ideone.com/Fq09N . Python is pass-by-value in a : meaningful sense, it's just that by saying that we say that the values : being pas

Re: What other languages use the same data model as Python?

2011-05-04 Thread Paul Rubin
Steven D'Aprano writes: x = "spam" > what is the value of the variable x? Is it...? > (1) The string "spam". Python works about the same way as Lisp or Scheme with regard to this sort of thing, and those languages have been described with quite a bit of mathematical formality. So if you wan

Handling the log in BaseHTTPServer

2011-05-04 Thread LehH Sdsk8
First, i'm sorry for any inglish error! So, i use the BaseHTTPServer to create a page for monitoring purposes, someone now how to direct the event log to a file? -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Steven D'Aprano
On Wed, 04 May 2011 02:56:28 -0700, Devin Jeanpierre wrote: > Python is pass-by-value in a > meaningful sense, it's just that by saying that we say that the values > being passed are references/pointers. This is maybe one level of > abstraction below what's ideal, "Maybe"? Given the following st

Re: What other languages use the same data model as Python?

2011-05-04 Thread Devin Jeanpierre
> To illustrate the neither-fish-nor-fowl nature of Python calls: > > mwilson@tecumseth:~$ python > Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) > [GCC 4.4.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information.>>> def > identify_call (a_list): > > ...   a_list[0]

Re: Running and killing a process in python

2011-05-04 Thread Jean-Michel Pichavant
James Mills wrote: On Wed, May 4, 2011 at 10:45 AM, Astan Chee wrote: Hi, I'm trying to make a python script (in windows 7 x64 using python 2.5) to start a process, and kill it after x minutes/seconds and kill all the descendants of it. Whats the best way of doing this in python? which modul

Re: Aborting Python from C code

2011-05-04 Thread Chris Angelico
On Sat, Apr 30, 2011 at 7:29 PM, Dylan Evans wrote: > I think i see what you are trying to do but it depends on the environment > and your goals. > Generally i think you need to separate your code by forking (or perhaps you > have already done that?), > then you can run a check to see if the proce

  1   2   >