Re: Purpose of operator package

2008-05-14 Thread castironpi
On May 14, 11:58 am, Matthew Woodcraft <[EMAIL PROTECTED]> wrote: > I V  <[EMAIL PROTECTED]> wrote: > > > I hadn't heard of operator.truth before. Does it do anything different > > from bool(x) ? > > Not really. It was occasionally useful before the bool type existed; > now it's just a leftover. >

Re: Purpose of operator package

2008-05-14 Thread Matthew Woodcraft
I V <[EMAIL PROTECTED]> wrote: > I hadn't heard of operator.truth before. Does it do anything different > from bool(x) ? Not really. It was occasionally useful before the bool type existed; now it's just a leftover. -M- -- http://mail.python.org/mailman/listinfo/python-list

Re: Purpose of operator package

2008-05-13 Thread Carl Banks
On May 13, 7:46 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On May 13, 6:09 pm, Eric Anderson <[EMAIL PROTECTED]> wrote: > > > I mainly work in other languages (mostly Ruby lately) but my text > > editor (Scribes) is python. With python being everywhere for dynamic > > scripting I thought I would r

Re: Purpose of operator package

2008-05-13 Thread Carl Banks
On May 13, 6:09 pm, Eric Anderson <[EMAIL PROTECTED]> wrote: > I mainly work in other languages (mostly Ruby lately) but my text > editor (Scribes) is python. With python being everywhere for dynamic > scripting I thought I would read the source to learn the language > better (I've gone through som

Re: Purpose of operator package

2008-05-13 Thread I V
On Wed, 14 May 2008 00:38:44 +0200, Christian Heimes wrote: > Eric Anderson schrieb: >> Seems like unnecessary code but obviously I know nothing about Python. > > Correct, the truth example isn't a good example. "if argv" is better. I hadn't heard of operator.truth before. Does it do anything dif

Re: Purpose of operator package

2008-05-13 Thread Christian Heimes
Eric Anderson schrieb: > Seems like unnecessary code but obviously I know nothing about Python. Correct, the truth example isn't a good example. "if argv" is better. But you can write interesting things with the operator module. For example >>> import operator >>> def fac(x): ... return reduc

Purpose of operator package

2008-05-13 Thread Eric Anderson
I mainly work in other languages (mostly Ruby lately) but my text editor (Scribes) is python. With python being everywhere for dynamic scripting I thought I would read the source to learn the language better (I've gone through some basic tutorials but I always prefer to learn from real source). So