RE: Remove whitespaces and line breaks in a XML file

2011-02-08 Thread David Vicente
I´ll try to mix it with my code (xml.etree). Thanks ;) -Mensaje original- De: python-list-bounces+dvicente=full-on-net@python.org [mailto:python-list-bounces+dvicente=full-on-net@python.org] En nombre de Josh English Enviado el: martes, 08 de febrero de 2011 0:46 Para: python-lis

Re: Easy function, please help.

2011-02-08 Thread Paul Rudin
Nanderson writes: > loop would be infinite. I get what is happening in the function, and I > understand why this would work, but for some reason it's confusing me > as to how it is exiting the loop after a certain number of times. Help > is appreciated, thanks. It works because 0 tests false an

Re: Easy function, please help.

2011-02-08 Thread Nanderson
On Feb 8, 10:29 pm, Michael Hrivnak wrote: > Your function only works if n is an integer.  Example: > > >>> num_digits(234) > 3 > >>> num_digits(23.4) > > 325 > > When doing integer division, python will throw away the remainder and > return an int.  Using your example of n==44, 44/10 == 4 and 4/1

Re: Easy function, please help.

2011-02-08 Thread Michael Hrivnak
Your function only works if n is an integer. Example: >>> num_digits(234) 3 >>> num_digits(23.4) 325 When doing integer division, python will throw away the remainder and return an int. Using your example of n==44, 44/10 == 4 and 4/10 == 0 Before each iteration of the while loop, the given exp

Easy function, please help.

2011-02-08 Thread Nanderson
def num_digits(n): count = 0 while n: count = count + 1 n = n / 10 return count This is a function that basically says how many digits are in a number. For example, >>>print num_digits(44) 2 >>>print num_digits(7654) 4 This function counts the number of decimal digits

Re: Reassign or discard Popen().stdout from a server process

2011-02-08 Thread Nobody
On Fri, 04 Feb 2011 15:48:55 +, John O'Hagan wrote: > But I'm still a little curious as to why even unsuccessfully attempting to > reassign stdout seems to stop the pipe buffer from filling up. It doesn't. If the server continues to run, then it's ignoring/handling both SIGPIPE and the EPIPE

Re: Wing in mod_python vs wsgi?

2011-02-08 Thread Doug Epling
I don't know about your IDE, I am using the default IDLE just because it is handy. But I have made the switch from mod_python. It was a good idea, but mod_wsgi is a better idea. And as you know, mod_python is no longer supported. I am running Apache with mod_wsgi in a windows 7 environment

Re: [python-list] - what do you think ?

2011-02-08 Thread Vivek Shrivastava
I think that will help people like me who just depend on gmail, and I know there are various ways to do filtering in gmail, but just addition of the tag in [ ] will help avoiding those.. I kindly second that... On Tue, Feb 8, 2011 at 6:12 PM, Rhodri James wrote: > On Wed, 09 Feb 2011 01:59:46 -00

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-08 Thread MRAB
On 09/02/2011 01:59, Yang Zhang wrote: I reduced a problem I was seeing in my application down into the following test case. In this code, a parent process concurrently spawns 2 (you can spawn more) subprocesses that read a big message from the parent over stdin, sleep for 5 seconds, and write so

Re: Socket connection between python and C

2011-02-08 Thread Dan Stromberg
On Tue, Feb 8, 2011 at 5:41 PM, Roy Smith wrote: > In article , >  "Williamson, Ross X. (Guest)" >  wrote: > >> Dear All, >> >> I'm trying to implement a server/client system where the server is written in >> python and the client has to be written in c/c++.  I can happily send simple >> text thr

Re: [python-list] - what do you think ?

2011-02-08 Thread Rhodri James
On Wed, 09 Feb 2011 01:59:46 -, David Robinow wrote: On Tue, Feb 8, 2011 at 5:03 PM, Rhodri James wrote: On Tue, 08 Feb 2011 12:18:50 -, wrote: On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: Either your mail client already knows how to filter messages appropriately d

Re: [python-list] - what do you think ?

2011-02-08 Thread David Robinow
On Tue, Feb 8, 2011 at 5:03 PM, Rhodri James wrote: > On Tue, 08 Feb 2011 12:18:50 -, wrote: >> On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: >>> Either your mail client already knows how to filter messages >>> appropriately depending on which mailing list they came from; or, yo

Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-08 Thread Yang Zhang
I reduced a problem I was seeing in my application down into the following test case. In this code, a parent process concurrently spawns 2 (you can spawn more) subprocesses that read a big message from the parent over stdin, sleep for 5 seconds, and write something back. However, there's unexpected

Re: Socket connection between python and C

2011-02-08 Thread Roy Smith
In article , "Williamson, Ross X. (Guest)" wrote: > Dear All, > > I'm trying to implement a server/client system where the server is written in > python and the client has to be written in c/c++. I can happily send simple > text through the socket. Ideally I would like make say a struct (u

Socket connection between python and C

2011-02-08 Thread Williamson, Ross X. (Guest)
Dear All, I'm trying to implement a server/client system where the server is written in python and the client has to be written in c/c++. I can happily send simple text through the socket. Ideally I would like make say a struct (using python struct library) - and then read that in using C. Is

Re: Idea for removing the GIL...

2011-02-08 Thread Jean-Paul Calderone
On Feb 8, 7:12 pm, Paul Rubin wrote: > But the refcount scheme is just an implementation hack > that gets rationalized way too much.  I hope PyPy abandons it. Done. :) Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Idea for removing the GIL...

2011-02-08 Thread Paul Rubin
sturlamolden writes: > comes with a cost. The interpreter will sometimes pause to collect > garbage. The memory use will be larger as well, as garbage remain > uncollected for a while and is not immediately reclaimed. Many rely on > CPython because the interpreter does not pause and a Python proce

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Icarus Sparry
On Tue, 08 Feb 2011 14:30:53 -0800, Xah Lee wrote: > On Feb 8, 9:32 am, Icarus Sparry wrote: [snip] >> The 'modern' way to do this is >> find . -maxdepth 2 -name '*.html' -exec grep whatever {} + >> >> The key thing which makes this 'modern' is the '+' at the end of the >> command, rather than '\

Re: Idea for removing the GIL...

2011-02-08 Thread sturlamolden
On 8 Feb, 10:39, Vishal wrote: > Is it possible that the Python process, creates copies of the > interpreter for each thread that is launched, and some how the thread > is bound to its own interpreter ? In .NET lingo this is called an 'AppDomain'. This is also how tcl works -- one interpreter p

Wing in mod_python vs wsgi?

2011-02-08 Thread Tom Stambaugh
I'm still using mod_python to deploy my framework for production (CentOS running Python 2.5.5, Apache 2.2.3, mod_python 3.3.1). I'm acutely aware of how elderly mod_python is, and I've had some frustrations using Wing to debug inside it -- at least its possible, which is not true for any other

Re: SunLisp III: Lisp jobs and beer in Ft Lauderdale

2011-02-08 Thread fortunatus
Are you using your qooxlisp thingy? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Xah Lee
On Feb 8, 9:32 am, Icarus Sparry wrote: > On Tue, 08 Feb 2011 13:51:54 +0100, Petter Gustad wrote: > > Xah Lee writes: > > >> problem with find xargs is that they spawn grep for each file, which > >> becomes too slow to be usable. > > > find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep wha

Re: frequency of values in a field

2011-02-08 Thread Vlastimil Brom
2011/2/8, Paul Rubin : > noydb writes: >> I am looking for ways to go about capturing the frequency of unique >> values in one field in a dbf table which contains ~50k records. The >> values are numbers with atleast 5 digits to the right of the decimal, >> but I want the frequency of values to on

Re: [python-list] - what do you think ?

2011-02-08 Thread Grant Edwards
On 2011-02-08, przemol...@poczta.fm wrote: > I have just subscribed to this python-list@ and this is my N list. > Usually many mailing lists use square brackets to identify its name > when you have e-mails from different forums. > Would you consider adding [] to this list also ? Please don't.

Re: [python-list] - what do you think ?

2011-02-08 Thread Rhodri James
On Tue, 08 Feb 2011 12:18:50 -, wrote: On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: przemol...@poczta.fm writes: > I have just subscribed to this python-list@ and this is my N list. > Usually many mailing lists use square brackets to identify its name > when you have e-mail

Re: [python-list] - what do you think ?

2011-02-08 Thread Ben Finney
przemol...@poczta.fm writes: > On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: > > Either way, please don't ask for the subject lines to be munged. > > Any technical reason why not ? No technical reason to my knowledge; but then, I haven't looked for one. The reason of “don't mess wit

Re: frequency of values in a field

2011-02-08 Thread Paul Rubin
noydb writes: > I am looking for ways to go about capturing the frequency of unique > values in one field in a dbf table which contains ~50k records. The > values are numbers with atleast 5 digits to the right of the decimal, > but I want the frequency of values to only 2 decimal places. I do >

Re: Idea for removing the GIL...

2011-02-08 Thread Carl Banks
On Feb 8, 11:49 am, John Nagle wrote: >     The real reason for the GIL, though, is to support dynamic > code modification in multi-thread progrems.  It's the ability > to replace a function while it's being executed in another thread > that's hard to do without a global lock.  If it were just a d

Re: Idea for removing the GIL...

2011-02-08 Thread John Nagle
On 2/8/2011 1:39 AM, Vishal wrote: Hello, This might sound crazy..and dont know if its even possible, but... Is it possible that the Python process, creates copies of the interpreter for each thread that is launched, and some how the thread is bound to its own interpreter ? This will increase

Re: Idea for removing the GIL...

2011-02-08 Thread Adam Tauno Williams
On Tue, 2011-02-08 at 11:52 -0500, Roy Smith wrote: > In article , > Robert Kern wrote: > > Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write > > semantics for initializing the memory of the new process. If you want to > > pass > > data to the children, the data must be

Re: frequency of values in a field

2011-02-08 Thread Josh English
You could try a collections.defaultdict object with an integer as the startup value: counts = collections.defaultdict(int) for thing in long_list: counts[get_last_two_digits(thing)] += 1 This assumes get_last_two_digits is the function that provides the key you want to count by. I'm not sure

frequency of values in a field

2011-02-08 Thread noydb
I am looking for ways to go about capturing the frequency of unique values in one field in a dbf table which contains ~50k records. The values are numbers with atleast 5 digits to the right of the decimal, but I want the frequency of values to only 2 decimal places. I do have a method to do this

Re: Where and when does Python say this to you?

2011-02-08 Thread Terry Reedy
On 2/8/2011 8:38 AM, Peter Otten wrote: import socket sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) If you do not like typing 'socket' so many times: import socket as so # or pick own abbreviation sock = so.socket(so.AF_UNIX, sot.SOCK_STREAM) Have you worked through the tutorial

Re: - what do you think ?

2011-02-08 Thread Terry Reedy
On 2/8/2011 7:18 AM, przemol...@poczta.fm wrote: On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: Either way, please don't ask for the subject lines to be munged. Any technical reason why not ? For one reason, python-list exchanges messages with both comp.lang.python and gmane.

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Petter Gustad
Icarus Sparry writes: > The 'modern' way to do this is > find . -maxdepth 2 -name '*.html' -exec grep whatever {} + Agree, I've noticed that recent version of find have the + option. I remember in the old days the exec method was considered bad since it would fork grep for each process, so I've

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Icarus Sparry
On Tue, 08 Feb 2011 13:51:54 +0100, Petter Gustad wrote: > Xah Lee writes: > >> problem with find xargs is that they spawn grep for each file, which >> becomes too slow to be usable. > > find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep whatever > > will call grep with a list of filenam

Re: Idea for removing the GIL...

2011-02-08 Thread Stefan Behnel
Roy Smith, 08.02.2011 17:52: Robert Kern wrote: Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write semantics for initializing the memory of the new process. If you want to pass data to the children, the data must be pickled and sent across the process boundary. He's not sa

Re: Unicode error in sax parser

2011-02-08 Thread Stefan Behnel
Rickard Lindberg, 08.02.2011 16:57: Hi, Here is a bash script to reproduce my error: #!/bin/sh cat> å.timeline< 0.13.0devb38ace0a572b+ 2011-02-01 00:00:00 2011-02-03 08:46:00 asdsd

Re: Idea for removing the GIL...

2011-02-08 Thread Roy Smith
In article , Robert Kern wrote: > Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write > semantics for initializing the memory of the new process. If you want to pass > data to the children, the data must be pickled and sent across the process > boundary. He's not saying t

Re: [python-list] - what do you think ?

2011-02-08 Thread Ethan Furman
przemol...@poczta.fm wrote: On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: Would you consider adding [] to this list also ? >>> No thank you. >> Any technical reason why not ? Nope. Just don't care for it. For those of us who have our e-mails automatically sorted into fold

Re: Unicode error in sax parser

2011-02-08 Thread Chris Rebert
On Tue, Feb 8, 2011 at 7:57 AM, Rickard Lindberg wrote: > Hi, > > Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference. >    #!/bin/sh > >    cat > å.timeline < >    EOF > >    python <    # encoding: utf-8 >    from xml.sa

Re: Idea for removing the GIL...

2011-02-08 Thread Robert Kern
On 2/8/11 10:11 AM, Brian Curtin wrote: On Tue, Feb 8, 2011 at 06:34, Vishal mailto:vsapr...@gmail.com>> wrote: Also, multiprocessing has issues on Windows (most probably because of the way CreateProcess() functions...) Such as? Unlike a UNIX fork, CreateProcess() does not have the sa

Re: Idea for removing the GIL...

2011-02-08 Thread Brian Curtin
On Tue, Feb 8, 2011 at 06:34, Vishal wrote: > Also, multiprocessing has issues on Windows (most probably because of > the way CreateProcess() functions...) Such as? -- http://mail.python.org/mailman/listinfo/python-list

Unicode error in sax parser

2011-02-08 Thread Rickard Lindberg
Hi, Here is a bash script to reproduce my error: #!/bin/sh cat > å.timeline < 0.13.0devb38ace0a572b+ 2011-02-01 00:00:00 2011-02-03 08:46:00 asdsd 2011-01-24 16:38:11

Re: Where and when does Python say this to you?

2011-02-08 Thread Grant Edwards
On 2011-02-08, Chris Rebert wrote: > On Tue, Feb 8, 2011 at 5:26 AM, gracemia gracemia wrote: >> ??File "prueba.py", line 4, in >> ?? ??sock = socket(AF_UNIX, SOCK_STREAM) >> NameError: name 'AF_UNIX' is not defined >> >> code: >> >> import socket >> sock = socket(AF_UNIX, SOCK_STREAM) > > You n

SunLisp III: Lisp jobs and beer in Ft Lauderdale

2011-02-08 Thread kenny
Come on down to the Frog & Toad for wild and crazy debates over parentheses on their own line and bring your resume -- the SunLisp core is from an up and coming Ft Lauderdale firm that is still looking for local Lisp (or Scheme or Clojure or...) talent. The pub: http://www.thefrogandtoadpub.com/

Re: Where and when does Python say this to you?

2011-02-08 Thread gracemia
On 8 feb, 14:40, Chris Rebert wrote: > On Tue, Feb 8, 2011 at 5:26 AM, gracemia gracemia wrote: > >  File "prueba.py", line 4, in > >    sock = socket(AF_UNIX, SOCK_STREAM) > > NameError: name 'AF_UNIX' is not defined > > > code: > > > import socket > > sock = socket(AF_UNIX, SOCK_STREAM) > > Yo

Re: Where and when does Python say this to you?

2011-02-08 Thread Peter Otten
gracemia gracemia wrote: > File "prueba.py", line 4, in > sock = socket(AF_UNIX, SOCK_STREAM) > NameError: name 'AF_UNIX' is not defined > > code: > > import socket > sock = socket(AF_UNIX, SOCK_STREAM) You need to qualify the variable names with the module name: import socket sock = soc

PyCon Australia 2011: 20th & 21st August, Sydney Masonic Center

2011-02-08 Thread Richard Jones
The second PyCon Australia will be held in Sydney on the weekend of the 20th and 21st of August at the Sydney Masonic Center. The first PyCon Australia was held in June 2010 and attracted over 200 Python programming enthusiasts. The second event is expected to host over 250 attendees. The weekend

Python Game Programming Challenge 12 (April 2011) is coming!

2011-02-08 Thread Richard Jones
The 12th Python Game Programming Challenge (PyWeek) is coming. It'll run from the 3rd to the 10th of April. The PyWeek challenge: - Invites entrants to write a game in one week from scratch either as an individual or in a team, - Is intended to be challenging and fun, - Will hopefully increase th

Re: Where and when does Python say this to you?

2011-02-08 Thread Chris Rebert
On Tue, Feb 8, 2011 at 5:26 AM, gracemia gracemia wrote: >  File "prueba.py", line 4, in >    sock = socket(AF_UNIX, SOCK_STREAM) > NameError: name 'AF_UNIX' is not defined > > code: > > import socket > sock = socket(AF_UNIX, SOCK_STREAM) You need to qualify all those names. Normal `import` does

Re: Where and when does Python say this to you?

2011-02-08 Thread Benjamin Kaplan
On Tue, Feb 8, 2011 at 8:27 AM, gracemia gracemia wrote: > This is the simple code: > > > import socket > > sock = socket(AF_UNIX, SOCK_STREAM) > -- > > Thank you I think you're having a bit of trouble with Python's

Re: Where and when does Python say this to you?

2011-02-08 Thread gracemia gracemia
this is the simple code: -- import socket # Create an unbound and not-connected socket. sock = socket(AF_UNIX, SOCK_STREAM) --- Thank you ! Submitted via EggHeadCafe SharePoint Tip / Thought of the

Re: Where and when does Python say this to you?

2011-02-08 Thread gracemia gracemia
This is the simple code: import socket sock = socket(AF_UNIX, SOCK_STREAM) -- Thank you Submitted via EggHeadCafe SQL Server CLR Stored Procedures for External Access http://www.eggheadcafe.com/tutorials/aspnet/08

Re: Where and when does Python say this to you?

2011-02-08 Thread gracemia gracemia
File "prueba.py", line 4, in sock = socket(AF_UNIX, SOCK_STREAM) NameError: name 'AF_UNIX' is not defined code: import socket sock = socket(AF_UNIX, SOCK_STREAM) Thank you ! Submitted via EggHeadCafe Statistics, Probability, Lotteries and Dumb Programmers http://www.eggheadcafe.com/tuto

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Petter Gustad
Xah Lee writes: > problem with find xargs is that they spawn grep for each file, which > becomes too slow to be usable. find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep whatever will call grep with a list of filenames given by find, only a single grep process will run. //Petter -- .s

Re: Idea for removing the GIL...

2011-02-08 Thread Jean-Paul Calderone
On Feb 8, 7:34 am, Vishal wrote: > On Feb 8, 3:05 pm, Adam Tauno Williams wrote: > > > On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote: > > > Is it possible that the Python process, creates copies of the > > > interpreter for each thread that is launched, and some how the thread > > > is bound to

Re: AF_UNIX socket not supported

2011-02-08 Thread Jean-Paul Calderone
On Feb 8, 7:30 am, gracemia wrote: > Hello ! > > I'm trying to develop with AF_UNIX socket type in python (2.5) but > python says that AF_UNIX is not supported > How can I do for work with AF_UNIX sockets? > > Thank you Where and when does Python say this to you? http://docs.python.org/library/s

Re: Idea for removing the GIL...

2011-02-08 Thread Vishal
On Feb 8, 3:05 pm, Adam Tauno Williams wrote: > On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote: > > Is it possible that the Python process, creates copies of the > > interpreter for each thread that is launched, and some how the thread > > is bound to its own interpreter ? > > and it "may" also a

On Windows, how do I protect arguments to shell scripts launched with subprocess?

2011-02-08 Thread arve.knud...@gmail.com
Hi Since upgrading to Python 2.7, I've run into the problem that when I launch shell scripts (.e.g, *.bat) via subprocess.Popen (with False for the 'shell' option, mind you), the arguments get interpreted by the shell. For instance, the '|' character, no longer gets passed verbatim to the script.

AF_UNIX socket not supported

2011-02-08 Thread gracemia
Hello ! I'm trying to develop with AF_UNIX socket type in python (2.5) but python says that AF_UNIX is not supported How can I do for work with AF_UNIX sockets? Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: [python-list] - what do you think ?

2011-02-08 Thread przemolicc
On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: > przemol...@poczta.fm writes: > > > I have just subscribed to this python-list@ and this is my N list. > > Usually many mailing lists use square brackets to identify its name > > when you have e-mails from different forums. > > Would you

Re: PDB how to define a global inspection function?

2011-02-08 Thread Peter Otten
Charles Fox (Sheffield) wrote: > Hi guys, I'm new to this group and have a question about debugging. > I'm stepping through my code (using emacs pdbtrack and python-mode.el) > and would like to isnpect objects as I go. So I've defined a little > object print function, > > def p(obj): > print

Re: [python-list] - what do you think ?

2011-02-08 Thread Peter Otten
przemol...@poczta.fm wrote: > I have just subscribed to this python-list@ and this is my N list. > Usually many mailing lists use square brackets to identify its name > when you have e-mails from different forums. > Would you consider adding [] to this list also ? A better approach is to configur

PDB how to define a global inspection function?

2011-02-08 Thread Charles Fox (Sheffield)
Hi guys, I'm new to this group and have a question about debugging. I'm stepping through my code (using emacs pdbtrack and python-mode.el) and would like to isnpect objects as I go. So I've defined a little object print function, def p(obj): print obj print obj.__class__ d=dir(obj)

Re: [python-list] - what do you think ?

2011-02-08 Thread Ben Finney
przemol...@poczta.fm writes: > I have just subscribed to this python-list@ and this is my N list. > Usually many mailing lists use square brackets to identify its name > when you have e-mails from different forums. > Would you consider adding [] to this list also ? No thank you. Either your mail

[python-list] - what do you think ?

2011-02-08 Thread przemolicc
Hello, I have just subscribed to this python-list@ and this is my N list. Usually many mailing lists use square brackets to identify its name when you have e-mails from different forums. Would you consider adding [] to this list also ? Please compare both version below: 5350 Feb 07 Richard Ho

Re: using attributes as defaults

2011-02-08 Thread Jean-Michel Pichavant
Westley Martínez wrote: On Fri, 2011-02-04 at 13:08 -0800, Wanderer wrote: I want to give the option of changing attributes in a method or using the current values of the attributes as the default. class MyClass(): """ my Class """ def __init__(self): """ initialize

Re: Idea for removing the GIL...

2011-02-08 Thread Adam Tauno Williams
On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote: > Is it possible that the Python process, creates copies of the > interpreter for each thread that is launched, and some how the thread > is bound to its own interpreter ? > and it "may" also allow the two threads to run in parallel, assuming > the

Idea for removing the GIL...

2011-02-08 Thread Vishal
Hello, This might sound crazy..and dont know if its even possible, but... Is it possible that the Python process, creates copies of the interpreter for each thread that is launched, and some how the thread is bound to its own interpreter ? This will increase the python process size...for sure, h

Re: exec, import and isinstance

2011-02-08 Thread Peter Otten
Michele Petrazzo wrote: > Hi all, > I'm playing with python internals and I'm discovering a strange behavior > of isinstance. Considering the following test case: > > test/bar.py > test/b.py > test/a/__init__.py > test/a/foo.py > > -- __init__.py -> empty > > --- foo.py: > class foo: pass > c =

exec, import and isinstance

2011-02-08 Thread Michele Petrazzo
Hi all, I'm playing with python internals and I'm discovering a strange behavior of isinstance. Considering the following test case: test/bar.py test/b.py test/a/__init__.py test/a/foo.py -- __init__.py -> empty --- foo.py: class foo: pass c = foo --- b.py def ret(): d = {} #s = "import sy