Re: I'm a python addict !

2009-01-28 Thread afriere
On Jan 27, 4:52 am, Paul McGuire wrote: [snip] > >     # how you have to do it in C++ and Java >     # light = light.next_state() > >     # using Python >     light.__class__ = light.next_state I'm sure you can, but why poke yourself in the eye with a blunt stick? ;) IMO there are two obvious pr

Re: I'm a python addict !

2009-01-27 Thread Bruno Desthuilliers
Paul McGuire a écrit : On Jan 26, 10:54 am, "J. Cliff Dyer" wrote: On Fri, 2009-01-23 at 20:25 -0800, Paul McGuire wrote: Want to change the type/behavior of an object from class A to class B? How about this: aobj = A() aobj.__class__ = B Try *that* in as simple-looking C++ or Java!

Re: I'm a python addict !

2009-01-26 Thread J. Cliff Dyer
On Mon, 2009-01-26 at 12:37 -0800, Paul McGuire wrote: > On Jan 26, 2:06 pm, "J. Cliff Dyer" wrote: > > > > Thanks. That makes sense. But your example creates a new instance of > > the new class each time, rather than changing the class of a persistent > > instance, as the original example, to

Re: I'm a python addict !

2009-01-26 Thread Paul McGuire
On Jan 26, 2:06 pm, "J. Cliff Dyer" wrote: > > Thanks.  That makes sense.  But your example creates a new instance of > the new class each time, rather than changing the class of a persistent > instance, as the original example, to which I was responding, did. > Look closer. The line that create

Re: I'm a python addict !

2009-01-26 Thread J. Cliff Dyer
On Mon, 2009-01-26 at 09:52 -0800, Paul McGuire wrote: > On Jan 26, 10:54 am, "J. Cliff Dyer" wrote: > > On Fri, 2009-01-23 at 20:25 -0800, Paul McGuire wrote: > > > Want to change the type/behavior of an object from class A to class > > > B? How about this: > > > > > aobj = A() > > > ao

Re: I'm a python addict !

2009-01-26 Thread Scott David Daniels
J. Cliff Dyer wrote: On Fri, 2009-01-23 at 20:25 -0800, Paul McGuire wrote: ... How about this: aobj = A() aobj.__class__ = B ... Wow. That looks very powerful and fun. But scary. Any thoughts on how you would use that in a way that wouldn't unleash sulphurous code smells? Seems li

Re: I'm a python addict !

2009-01-26 Thread Paul McGuire
On Jan 26, 10:54 am, "J. Cliff Dyer" wrote: > On Fri, 2009-01-23 at 20:25 -0800, Paul McGuire wrote: > > Want to change the type/behavior of an object from class A to class > > B?  How about this: > > >     aobj = A() > >     aobj.__class__ = B > > > Try *that* in as simple-looking C++ or Java! >

Re: I'm a python addict !

2009-01-26 Thread J. Cliff Dyer
On Fri, 2009-01-23 at 20:25 -0800, Paul McGuire wrote: > Want to change the type/behavior of an object from class A to class > B? How about this: > > aobj = A() > aobj.__class__ = B > > Try *that* in as simple-looking C++ or Java! Wow. That looks very powerful and fun. But scary. An

Re: I'm a python addict !

2009-01-26 Thread J. Cliff Dyer
On Mon, 2009-01-26 at 14:43 -0800, J Kenneth King wrote: > Linuxguy123 writes: > > > I just started using python last week and I'm addicted. > > > > I hate Perl. I never did learn to use it with any competence. I has to > > be the most obfuscated, cryptic language I've ever seen. Making it >

Re: I'm a python addict !

2009-01-26 Thread J Kenneth King
J Kenneth King writes: > Linuxguy123 writes: > >> I just started using python last week and I'm addicted. >> >> I hate Perl. I never did learn to use it with any competence. I has to >> be the most obfuscated, cryptic language I've ever seen. Making it >> "object oriented" only makes it worse

Re: I'm a python addict !

2009-01-26 Thread J Kenneth King
Linuxguy123 writes: > I just started using python last week and I'm addicted. > > I hate Perl. I never did learn to use it with any competence. I has to > be the most obfuscated, cryptic language I've ever seen. Making it > "object oriented" only makes it worse ! > .. .. I program full-time

Re: I'm a python addict !

2009-01-25 Thread Andreas Waldenburger
On Sat, 24 Jan 2009 23:53:17 + MRAB wrote: > Terry Reedy wrote: > > For a Python 'program', see http://xkcd.com/534/ > > > It doesn't follow PEP 8! So Randall can just forget about getting xkcd in the Standard Library. Let this be an example to all of you­! /W -- My real email address is

Re: I'm a python addict !

2009-01-24 Thread Russ P.
On Jan 24, 4:03 pm, Robert Kern wrote: > On 2009-01-23 22:25, Aahz wrote: > > > In article, > > Linuxguy123  wrote: > >> I just started using python last week and I'm addicted. > > > Welcome!  Just be aware that excessive Perl-bashing is considered > > somewhat tasteless on this newsgroup, but the

Re: I'm a python addict !

2009-01-24 Thread Robert Kern
On 2009-01-23 22:25, Aahz wrote: In article, Linuxguy123 wrote: I just started using python last week and I'm addicted. Welcome! Just be aware that excessive Perl-bashing is considered somewhat tasteless on this newsgroup, but the occasional snide comment should be fine. ;-) Or bash-bashi

Re: I'm a python addict !

2009-01-24 Thread MRAB
Terry Reedy wrote: Benjamin Kaplan wrote: On Sat, Jan 24, 2009 at 5:35 PM, Lie Ryan > wrote: On Fri, 23 Jan 2009 19:58:09 -0700, Linuxguy123 wrote: > I just started using python last week and I'm addicted. you need to try this: import antigravit

Re: I'm a python addict !

2009-01-24 Thread Terry Reedy
Benjamin Kaplan wrote: On Sat, Jan 24, 2009 at 5:35 PM, Lie Ryan > wrote: On Fri, 23 Jan 2009 19:58:09 -0700, Linuxguy123 wrote: > I just started using python last week and I'm addicted. you need to try this: import antigravity http://xkcd.c

Re: I'm a python addict !

2009-01-24 Thread Benjamin Kaplan
On Sat, Jan 24, 2009 at 5:35 PM, Lie Ryan wrote: > On Fri, 23 Jan 2009 19:58:09 -0700, Linuxguy123 wrote: > > > I just started using python last week and I'm addicted. > > you need to try this: > > import antigravity > > http://xkcd.com/353/ > Just be careful with that. That guy was still floati

Re: I'm a python addict !

2009-01-24 Thread Lie Ryan
On Fri, 23 Jan 2009 19:58:09 -0700, Linuxguy123 wrote: > I just started using python last week and I'm addicted. you need to try this: import antigravity http://xkcd.com/353/ -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm a python addict !

2009-01-23 Thread Russ P.
On Jan 23, 6:58 pm, Linuxguy123 wrote: > I will never write another Perl or Bash script again. I still use bash for orchestrating the execution of a series of other scripts and/or programs (including python programs). I know you can do that in python, but I find bash simpler to use for that purp

Re: I'm a python addict !

2009-01-23 Thread Aahz
In article , Linuxguy123 wrote: > >I just started using python last week and I'm addicted. Welcome! Just be aware that excessive Perl-bashing is considered somewhat tasteless on this newsgroup, but the occasional snide comment should be fine. ;-) -- Aahz (a...@pythoncraft.com) <*>

Re: I'm a python addict !

2009-01-23 Thread Paul McGuire
On Jan 23, 8:58 pm, Linuxguy123 wrote: > I just started using python last week and I'm addicted. > > I see a lot of Python in my future. Bravo, welcome, and well-said! Your sentiments mirror and resonate with those of many on this list. About 6 years ago I wanted a scripting language to wor