Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-27 Thread Stephen R Laniel
x27;t need to be a religious war. Why can't people just say "When strong typing is done and used well, it's a useful tool; when it's not, it's not"? -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel

Re: Return name of caller function?

2007-06-27 Thread Stephen R Laniel
caller = stack[1][3] print "I am the slave; my caller was %s" % caller def main(): master() if __name__ == '__main__': main() -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.key -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-27 Thread Stephen R Laniel
oint about what static typing is for in general (i.e., not specific to Python). I thought I'd give examples of how languages other than Python use it to good effect, and not just for compiler optimization. Cheers, Steve -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http:/

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-27 Thread Stephen R Laniel
again to Mark-Jason Dominus's explanation of how strong static typing can be done well: http://perl.plover.com/yak/typing/notes.html The example toward the end of how ML actually spots an infinite loop at compile time seems to me to be "for programmers" rather than "for compiler

Re: Return name of caller function?

2007-06-26 Thread Stephen R Laniel
pect is your friend: http://docs.python.org/lib/inspect-stack.html -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.key -- http://mail.python.org/mailman/listinfo/python-list

Re: Help needed in Handling HTML file

2007-06-26 Thread Stephen R Laniel
a scriptable Python object; I do not. -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.key -- http://mail.python.org/mailman/listinfo/python-list

Re: finding an element in a string

2007-06-25 Thread Stephen R Laniel
# things one does if the user said 'fine' Alternately, you could just use rfind(): http://docs.python.org/lib/string-methods.html but regexes are a good tool to get to know. They're overused (particularly in Perl), but this is just the sort of task they're good for. -- Stephen

Re: server wide variables

2007-06-25 Thread Stephen R Laniel
python.org/lib/os-procinfo.html -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.key -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie tcp/ip question

2007-06-24 Thread Stephen R Laniel
On Sun, Jun 24, 2007 at 02:52:25PM -0500, Zachary Manning wrote: > I want to send some hex characters as a string literal to port 7142 and > to a specific ip address. How do I do that in python? Does this cover what you want to do? http://docs.python.org/lib/socket-example.html -- Ste

Re: Tailing a log file?

2007-06-22 Thread Stephen R Laniel
ing inotify. So I guess I answered my own question. I've not thought about it much, but how about using Twisted? Something like the LineReceiver class seems appropriate here. http://twistedmatrix.com/documents/current/api/twisted.protocols.basic.LineReceiver.html -- Stephen R. Laniel [EMAIL

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Stephen R Laniel
On Thu, Jun 21, 2007 at 10:11:57AM -0400, Stephen R Laniel wrote: > "Use another language" is not a technical answer. "Python > could not adopt static typing without substantially changing > the language and destroying what everyone loves about it, > and here are ex

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Stephen R Laniel
lowup clarified something that I should have included in the original. "Use another language" is not a technical answer. "Python could not adopt static typing without substantially changing the language and destroying what everyone loves about it, and here are examples of where the

Re: strip() 2.4.4

2007-06-21 Thread Stephen R Laniel
On Thu, Jun 21, 2007 at 01:42:03PM +, linuxprog wrote: > that should work for you ? I reproduced the original poster's problem by adding one extra space after the final "'" on each line. I'd vote that that's the problem. -- Stephen R. Laniel [EMAIL PROT

Re: strip() 2.4.4

2007-06-21 Thread Stephen R Laniel
it? -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.key -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-20 Thread Stephen R Laniel
, I reasoned, use this information at compile time? Of course I understand the virtue of writing code with good doctests, etc. But my question is why we can't get some more static typing as well. Given the tools that'll be in Python 3.0, that doesn't seem unreasonable to ask. A

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-20 Thread Stephen R Laniel
On Wed, Jun 20, 2007 at 12:59:28PM -0700, [EMAIL PROTECTED] wrote: > Then you should use another language. This is what I meant about knowing how Internet discussions go. -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.

PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-20 Thread Stephen R Laniel
tima.com/intv/strongweakP.html -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.key -- http://mail.python.org/mailman/listinfo/python-list

Re: Html parser

2007-06-15 Thread Stephen R Laniel
On Fri, Jun 15, 2007 at 07:11:56AM -0700, HMS Surprise wrote: > Could you recommend an html parser that works with python (jython > 2.2)? I'm new here, but I believe BeautifulSoup is the canonical answer: http://www.crummy.com/software/BeautifulSoup/ -- Stephen R. Laniel [EMAIL PROT

Failing on string exceptions in 2.4

2007-06-14 Thread Stephen R Laniel
it just to fail there and not let me raise an exception that isn't subclassed beneath Exception. -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.key -- http://mail.python.org/mailman/listinfo/python-list