[Tutor] __mul__ for different variable types?

2009-10-04 Thread Warren
I'm a little confused on this one. I have a Vector class that I want to be able to multiply by either another vector or by a single float value. How would I implement this in my override of __mul__ within that class? Do you check the variable type with a stack of "if isinstance" stateme

Re: [Tutor] small program

2009-10-04 Thread Luke Paireepinart
On Sun, Oct 4, 2009 at 1:59 PM, Andrius wrote: > Very good. Nice to hear that from another 'untouchable'. Must to > confirm for your that I'm usually left wing fella, so, if you have > nothing what to say for my in my case - please, fuck off. Re: http://catb.org/~esr/faqs/smart-questions.html#n

[Tutor] using easy_install to download eggs

2009-10-04 Thread Tim Michelsen
Hello, I would like to use easy_install to cache packages registered at PyPi locally. How can I do this for packages? I tried the hints from: http://peak.telecommunity.com/DevCenter/EasyInstall#installing-on-un-networked-machines It worked for some packages. But for others, the command easy_ins

[Tutor] Using a list comp in place of a for loop

2009-10-04 Thread afith13
Hi tutors, I've got a loop and a comprehension that do the same thing (as far as I can tell): for i in range(N): someList.append.newObject(i) ...and... [someList.append.newObject(i) for i in range(N)] I'm tempted to write this as a list comp because it's a big list and I've read that list

Re: [Tutor] __mul__ for different variable types?

2009-10-04 Thread Rich Lovely
2009/10/4 Warren : > > I'm a little confused on this one. > > I have a Vector class that I want to be able to multiply by either another > vector or by a single float value.  How would I implement this in my > override of __mul__ within that class? > > Do you check the variable type with a stack of

Re: [Tutor] __mul__ for different variable types?

2009-10-04 Thread Warren
Awesome, Rich, thanks! - Warren (war...@wantonhubris.com) On Oct 4, 2009, at 5:31 PM, Rich Lovely wrote: 2009/10/4 Warren : I'm a little confused on this one. I have a Vector class that I want to be able to multiply by either another vector or by a single float value. How would I im

Re: [Tutor] Using a list comp in place of a for loop

2009-10-04 Thread Rich Lovely
2009/10/3 afith13 : > Hi tutors, > > I've got a loop and a comprehension that do the same thing (as far as I can > tell): > > for i in range(N): >  someList.append.newObject(i) > > ...and... > > [someList.append.newObject(i) for i in range(N)] > > I'm tempted to write this as a list comp because i