Re: isatty() for file-like objects: Implement or not?

2005-10-04 Thread Neal Norwitz
HOWARD GOLDEN wrote: > The standard documentation for isatty() says: > > "Return True if the file is connected to a tty(-like) device, else > False. Note: If a file-like object is not associated with a real file, > this method should not be implemented." > > In his book, "Text Processing in

Re: Python 2.4.2 HPUX-PARISC compile issues

2005-10-05 Thread Neal Norwitz
[EMAIL PROTECTED] wrote: > When compiling HPUX for PARISC with the following environemnt variables > I get the following errors. > > CFLAGS=+DD64 -fast > CC=aCC > LDFLAGS=+DD64 > > What do I need to do in order to get this to compile? This info should be in the README file for 2.4.2: + To b

Re: Idle bytecode query on apparently unreachable returns

2005-10-09 Thread Neal Norwitz
Tom Anderson wrote: > Evening all, > > Here's a brief chat with the interpretator: [snip] > What puzzles me, though, are bytecodes 17, 39 and 42 - surely these aren't > reachable? Does the compiler just throw in a default 'return None' > epilogue, with routes there from every code path, even when

Re: Python reliability

2005-10-09 Thread Neal Norwitz
Ville Voipio wrote: > > The software should be running continously for > practically forever (at least a year without a reboot). > Is the Python interpreter (on Linux) stable and > leak-free enough to achieve this? Jp gave you the answer that he has done this. I've spent quite a bit of time since

Re: Can module access global from __main__?

2005-10-11 Thread Neal Norwitz
Steve Holden wrote: > Neal Becker wrote: > > > > Still curious about the answer. If I know that I am imported from __main__, > > then I can do access X as sys.modules[__main__].X. In general, I don't > > know how to determine who is importing me. > > > I don't think you can without huge amounts o

Re: python interpreter

2005-10-13 Thread Neal Norwitz
g.franzkowiak wrote: > Hi everybody, > > my interest is for the internals of the Python interpreter. > > I've used up to now FORTH for something and this indirect interpreter is > very smart. > --- ASM --- > > Where can I find information

Re: Python script produces "sem_trywait: Permission denied"

2005-10-18 Thread Neal Norwitz
Mark E. Hamilton wrote: > Sorry, I probably should have re-stated the problem: > > We're using Python 2.3.5 on AIX 5.2, and get the follow error messages > from some of our code. I haven't yet tracked down exactly where it's > coming from: > > sem_trywait: Permission denied > sem_wait: Permission d

Re: make: circular dependency for Modules/signalmodule.o

2005-10-18 Thread Neal Norwitz
James Buchanan wrote: > Hi group, > > I'm preparing Python 2.4.2 for the upcoming Minix 3.x release, and I > have problems with make. configure runs fine and creates the makefile, > but right at the end ends with an error about a circular dependency in > Modules/signalmodule.o. I've never heard o

Re: Extention Woes

2005-10-19 Thread Neal Norwitz
Tuvas wrote: > Forgot, var declartions > > int can_han; > int com; > char len; > char dat[8]; That should probably be: int len; char *dat; IIRC, "z" returns the internal string pointer. "#" is definitely not going to return a char. I'm pretty sure it r

Re: python gc performance in large apps

2005-10-22 Thread Neal Norwitz
Jp Calderone wrote: > On Fri, 21 Oct 2005 16:13:09 -0400, Robby Dermody <[EMAIL PROTECTED]> wrote: > > > > [snip - it leaks memory] > > One thing to consider is that the process may be growing in size, not because > garbage objects are not being freed, but because objects which should be > garbag

Re: dictionary that have functions with arguments

2005-11-02 Thread Neal Norwitz
Ron Adam wrote: > > Eval or exec aren't needed. Normally you would just do... > > execfunc['key1'](**args) > > If your arguments are stored ahead of time with your function... > > Committed revision 41366. > > You could then do... > > func, args = execfunc['key1'] > func(**args)

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-14 Thread Neal Norwitz
Alex Martelli wrote: > > So, I thought I'd turn to the "wisdom of crowds"... how would YOU guys > go about adding to your automated regression tests one that checks that > a certain memory leak has not recurred, as cross-platform as feasible? > In particular, how would you code _memsize() "cross-pl

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread Neal Norwitz
Alex Martelli wrote: > matt <[EMAIL PROTECTED]> wrote: > > > Perhaps you could extend Valgrind (http://www.valgrind.org) so it works > > with python C extensions? (x86 only) > > Alas, if it's x86 only I won't even look into the task (which does sound > quite daunting as the way to solve the appare

Re: Any college offering Python short term course?

2005-11-21 Thread Neal Norwitz
There is the BayPiggies user group: [EMAIL PROTECTED] It meets monthly alternating between Mt. VIew (Google) and San Bruno (IronPort). n -- bruce wrote: > hey... > > i'm looking for classes (advanced) in python/php in the bay area as well... > actually i'm looking for the students/teachers/prof

Re: 2.4.2 on AIX 4.3 make fails on threading

2005-11-22 Thread Neal Norwitz
Paul Watson wrote: > When I try to build 2.4.2 on AIX 4.3, it fails on missing thread > objects. I ran ./configure --without-threads --without-gcc. > > Before using --without-threads I had several .pthread* symbols missing. Perhaps you need to add -lpthread to the link line. This should be able

Re: Singleton and C extensions

2005-11-25 Thread Neal Norwitz
Emmanuel Briot wrote: > > I am not really good at python, but I was trying to implement the > singleton design pattern in C, so that for instance calling the constructor > >ed = Editor ("foo") > > would either return an existing instance of Editor currently editing > "foo", or would create a ne

Re: A bug in struct module on the 64-bit platform?

2005-11-30 Thread Neal Norwitz
[EMAIL PROTECTED] wrote: > Hi, > > I have a user who complained about how "struct" module computes C > struct data size on Itanium2 based 64-bit machine. I wouldn't be surprised, but I don't understand the problem. >>>struct.calcsize('idi') >16 >>>struct.calcsize('idid') >24 >

Re: tkinter socket client ?

2005-01-21 Thread Neal Norwitz
You are probably looking for Tkinter.createfilehandler(). Here are some snippets to get you started: tk_reactor = Tkinter._tkinter self.sd = socket(AF_INET, SOCK_STREAM) self.sd.connect((HOST, PORT)) tk_reactor.createfilehandler(self.sd, Tkinter.READABLE, self.handle_input) def handle_input(self

PyChecker lives, version 0.8.15 released

2005-08-31 Thread Neal Norwitz
Special thanks to Ken Pronovici. He did a lot of work for this release and helped ensure it occurred. Version 0.8.15 of PyChecker is available. It's been over a year since the last release. Wow, time really does fly. Since it's been so long I'm sure I screwed something up, treat it delicately.

Re: Python Design Principles

2005-09-09 Thread Neal Norwitz
[EMAIL PROTECTED] wrote: > > But I am still puzzled by the argument that has been given for why > methods that operate on mutable types should return None, namely, that > the designers of python didn't want the users to shoot themselves in > the foot by thinking a method simply returned a result an

Re: Simplifying imports?

2005-09-12 Thread Neal Norwitz
[EMAIL PROTECTED] wrote: > I like to keep my classes each in a separate file with the same name of > the class. The problem with that is that I end up with multiple imports > in the beginning of each file, like this: > > from foo.Bar import Bar > from foo.Blah import Blah > from foo.Zzz import Zzz

[ANN] PyChecker 0.8.17 released

2006-02-03 Thread Neal Norwitz
A new version of PyChecker is available. There are two notable new features (command line options): --only and -#/--limit. --only will only print warnings from files specified on the command line. --limit will limit the number of warnings printed. By default, only 10 warnings are

Re: porting help

2005-05-21 Thread Neal Norwitz
You may need to write your own dynload_vxworks.c. Notice there are various OS specific dynload_*.c files. You can try to use dynload_stub.c to see if you can get it to compile. You may also need to muck with Include/pyport.h and configure to get things going. Good Luck! n -- http://mail.pytho

Re: Binding the names in a module in a class instance

2005-05-23 Thread Neal Norwitz
Jacob H wrote: > Hello all, > > I would like to be able to take a module full of class instances, > functions, etc and bind all its names to a separate container class in > a different module. I have come up with the following way to do it.. [snip] > I feel uneasy about this method. I foresee bad

Re: any macro-like construct/technique/trick?

2005-06-02 Thread Neal Norwitz
Andrew's approach is good, but you could so something a little simpler/more flexible. Untested of course. :-) Every callable object is followed by the args to pass it. So this: debug_emit(DbgObjFoo(a, b, costly_function(c))) becomes: debug_emit(DbgObjFoo, (a, b, costly_function, (c,)))

Python Software Foundation seeks mentors and students for Google Summer of Code

2006-04-20 Thread Neal Norwitz
ing a student though PSF are encouraged to contact me, Neal Norwitz at [EMAIL PROTECTED] People unknown to Guido or myself should find a couple of people known within the Python community who are willing to act as references. Feel free to contact me if you have any questions. I look forward to meeting

Summer of Code mailing list

2006-04-28 Thread Neal Norwitz
There's a new SoC mailing list. [EMAIL PROTECTED] You can sign up here: http://mail.python.org/mailman/listinfo/soc2006 This list is for any SoC discussion: mentors, students, idea, etc. Student can submit applications starting May 1, so now is the time to get students interested in your

Seeking students for the Summer of Code

2006-05-03 Thread Neal Norwitz
There is less than a week left before students must submit a final application. There are a bunch of ideas up on the wiki: http://wiki.python.org/moin/SummerOfCode/ The wiki has instructions for how to submit a proposal. There are many different areas including: core language features, lib

IMPORTANT 2.5 API changes for C Extension Modules and Embedders

2006-04-11 Thread Neal Norwitz
If you don't write or otherwise maintain Python Extension Modules written in C (or C++) or embed Python in your application, you can stop reading. Python 2.5 alpha 1 was released April 5, 2006. The second alpha should be released in a few weeks. There are several changes which can cause C extens

IMPORTANT 2.5 API changes for C Extension Modules and Embedders

2006-04-14 Thread Neal Norwitz
If you don't write or otherwise maintain Python Extension Modules written in C (or C++) or embed Python in your application, you can stop reading. Python 2.5 alpha 1 was released April 5, 2006. The second alpha should be released in a few weeks. There are several changes which can cause C extens