Re: bool behavior in Python 3000?

2007-07-12 Thread Nis Jørgensen
Alan Isaac skrev: Since it is seemingly ignored in most of the comments on this thread, I just want to remind that PEP 285 http://www.python.org/dev/peps/pep-0285/ says this: In an ideal world, bool might be better implemented as a separate integer type that knows how to

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

2007-07-05 Thread Nis Jørgensen
Bruno Desthuilliers skrev: Paul Rubin a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: Haskell - as other languages using type-inference like OCaml - are in a different category. Yes, I know, don't say it, they are statically typed - but it's mostly structural typing, not declarative

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Nis Jørgensen
Steven D'Aprano skrev: On Wed, 04 Jul 2007 23:53:15 -0400, David Abrahams wrote: on Wed Jul 04 2007, Steven D'Aprano steve-AT-REMOVE.THIS.cybersource.com.au wrote: On Wed, 04 Jul 2007 14:37:34 +, Marc 'BlackJack' Rintsch wrote: On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Nis Jørgensen
Neil Cerutti skrev: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this unecessarily hard to parse (it requires more than one character of lookahead for no reason except bad design) data format. I knew there had to

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Nis Jørgensen
Wildemar Wildenburger skrev: Nis Jørgensen wrote: Neil Cerutti skrev: Mostly you can use the default 'excel' dialect and be quite happy, since Excel is the main reason anybody still cares about this unecessarily hard to parse (it requires more than one character of lookahead

Re: Generator for k-permutations without repetition

2007-07-04 Thread Nis Jørgensen
bullockbefriending bard skrev: I was able to google a recipe for a k_permutations generator, such that i can write: x = range(1, 4) # (say) [combi for combi in k_permutations(x, 3)] = [[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 2, 1], [1, 2, 2], [1, 2, 3], [1, 3, 1], [1, 3, 2], [1, 3, 3],

Re: Generator for k-permutations without repetition

2007-07-04 Thread Nis Jørgensen
bullockbefriending bard skrev: On Jul 4, 7:09 pm, Nis Jørgensen [EMAIL PROTECTED] wrote: bullockbefriending bard skrev: A quick solution, not extensively tested # base needs to be an of the python builtin set def k_perm(base,k): for e in base: if k == 1

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Nis Jørgensen
Bruno Desthuilliers skrev: Why do people do this without posting what the actual solution is Probably because those people think usenet is a free help desk ? Usenet definitely isn't a help desk. You often get useful answers from usenet, from people who are not reading from a script. Nis

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Nis Jørgensen
Bruno Desthuilliers skrev: Why do people do this without posting what the actual solution is Probably because those people think usenet is a free help desk ? Usenet definitely isn't a help desk. You often get useful answers from usenet, from people who are not reading from a script. Nis

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Nis Jørgensen
Bruno Desthuilliers skrev: Why do people do this without posting what the actual solution is Probably because those people think usenet is a free help desk ? Usenet definitely isn't a help desk. You often get useful answers from usenet, from people who are not reading from a script. Nis

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Nis Jørgensen
Bruno Desthuilliers skrev: Why do people do this without posting what the actual solution is Probably because those people think usenet is a free help desk ? Usenet definitely isn't a help desk. You often get useful answers from usenet, from people who are not reading from a script. Nis

Re: mapping subintervals

2007-06-13 Thread Nis Jørgensen
Matteo skrev: OK - I'm going to assume your intervals are inclusive (i.e. 34-51 contains both 34 and 51). If your intervals are all really all non-overlapping, one thing you can try is to put all the endpoints in a single list, and sort it. Then, you can use the bisect module to search for

Re: for ... else ?

2007-06-12 Thread Nis Jørgensen
exhuma.twn skrev: for number in range(10,100): for divisor in range(2,number): if number % divisor == 0: break else: print number, Oh my. Would it not be an idea to rename this else into a finally? As Gabriel points out, the else-block gets

Re: Thunderbird access to this newsgroup

2007-06-12 Thread Nis Jørgensen
Rostfrei skrev: Hello! I'm writing this message over Google web access. I'm trying to access to the comp.lang.python newsgroup trough the Thunderbird, but I just can't configure it properly. What is the news server for this newsgroup. If I ping comp.lang.python it is not resolved. For

Re: Newbie question - better way to do this?

2007-05-28 Thread Nis Jørgensen
Steve Howell skrev: def firstIsCapitalized(word): return 'A' = word[0] = 'Z' For someone who is worried about the impact of non-ascii identifiers, you are making surprising assumptions about the contents of data. Nis -- http://mail.python.org/mailman/listinfo/python-list

Re: unit testing

2007-05-28 Thread Nis Jørgensen
Steve Howell skrev: And, really, if you're not doing automated tests on your application now, you don't know what you're missing. Quote of the day, IMO. Nis -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question - better way to do this?

2007-05-28 Thread Nis Jørgensen
Steve Howell skrev: --- Nis Jørgensen [EMAIL PROTECTED] wrote: Steve Howell skrev: def firstIsCapitalized(word): return 'A' = word[0] = 'Z' For someone who is worried about the impact of non-ascii identifiers, you are making surprising assumptions about the contents of data

Re: Create an XML document

2007-05-22 Thread Nis Jørgensen
[EMAIL PROTECTED] skrev: Hi all, I am attempting to create an XML document dynamically with Python. It needs the following format: zAppointments reminder=15 appointment begin1179775800/begin duration1800/duration /appointment /zAppointments