Re: Confessions of a Python fanboy

2015-05-10 Thread Mark Lawrence
On 11/05/2015 07:15, Steven D'Aprano wrote: On Monday 11 May 2015 11:46, zipher wrote: By having methods like len() in your built-in namespace when it's really only relevant to objects that are types of containers, you blur one primary component of OOP: encapsulation. Gosh, one would almost

Re: Confessions of a Python fanboy

2015-05-10 Thread Steven D'Aprano
On Monday 11 May 2015 11:46, zipher wrote: > By having methods like len() in your built-in namespace when it's really > only relevant to objects that are types of containers, you blur one > primary component of OOP: encapsulation. Gosh, one would almost think that Python's concept of OOP wasn't

Re: OFFTOPIC, WAS Re: Confessions of a Python fanboy

2015-05-10 Thread Ben Finney
zipher writes: > On Sunday, May 10, 2015 at 9:18:55 PM UTC-5, Chris Angelico wrote: > > That actually has nothing to do with it. You're still quoting > > without citation. > > Well, I replied right at the point of my correspondent (Alex23). That's not the issue :-) The omission Chris is referri

OFFTOPIC, WAS Re: Confessions of a Python fanboy

2015-05-10 Thread zipher
On Sunday, May 10, 2015 at 9:18:55 PM UTC-5, Chris Angelico wrote: > On Mon, May 11, 2015 at 12:11 PM, zipher wrote: > >> Please take care of your quoting. You just quoted two other posts, and > >> I have no idea who said things without going and digging in the > >> archive. > > > > I'm sorry. I'

Re: Confessions of a Python fanboy

2015-05-10 Thread Chris Angelico
On Mon, May 11, 2015 at 12:11 PM, zipher wrote: >> Please take care of your quoting. You just quoted two other posts, and >> I have no idea who said things without going and digging in the >> archive. > > I'm sorry. I've been sleeping on the beach, away from civilization, a little > too long, an

Re: Confessions of a Python fanboy

2015-05-10 Thread zipher
> Please take care of your quoting. You just quoted two other posts, and > I have no idea who said things without going and digging in the > archive. I'm sorry. I've been sleeping on the beach, away from civilization, a little too long, and didn't see that this was a post from 6 years ago. Feel

Re: Confessions of a Python fanboy

2015-05-10 Thread Chris Angelico
On Mon, May 11, 2015 at 11:46 AM, zipher wrote: >> > 3.) true OOP >> > Now before you go and get all "huffy" over this statement, hear me >> > out. Python is the best language in the world. But it damn sure has >> > some warts! "len(this)" instead of "obj.length" max(that) instead of >> > [1,2,3,4

Re: Confessions of a Python fanboy

2015-05-10 Thread zipher
> > 3.) true OOP > > Now before you go and get all "huffy" over this statement, hear me > > out. Python is the best language in the world. But it damn sure has > > some warts! "len(this)" instead of "obj.length" max(that) instead of > > [1,2,3,4,5].max(). > > As the Zen says: '[P]racticality beats

Re: Confessions of a Python fanboy

2009-08-26 Thread Luis Zarrabeitia
On Friday 31 July 2009 04:08:33 am Masklinn wrote: > On 30 Jul 2009, at 23:57 , Luis Zarrabeitia wrote: > > I'd like to ask, what "container.each" is, exactly? It looks like a > > function > > call (as I've learned a few posts ago), but, what are its arguments? > > How the > > looping "works"? Does

Re: Confessions of a Python fanboy

2009-08-05 Thread Just Another Victim of the Ambient Morality
"Steven D'Aprano" wrote in message news:pan.2009.08.04.09.28...@remove.this.cybersource.com.au... > On Tue, 04 Aug 2009 10:03:53 +0200, Bruno Desthuilliers wrote: > >>> Disadvantages: your code is filled with line noise. It's an arbitrary >>> choice between @@ meaning instance attribute and @@ m

Re: Confessions of a Python fanboy

2009-08-04 Thread Masklinn
On 4 Aug 2009, at 11:28 , Steven D'Aprano wrote: So I'd ask, does Smalltalk's message passing model match the way human beings think? Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-08-04 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Tue, 04 Aug 2009 10:03:53 +0200, Bruno Desthuilliers wrote: > >>> Disadvantages: your code is filled with line noise. It's an arbitrary >>> choice between @@ meaning instance attribute and @@ meaning class >>> attribute -- there's no logical reason for choosing one o

Re: Confessions of a Python fanboy

2009-08-04 Thread Steven D'Aprano
On Tue, 04 Aug 2009 10:03:53 +0200, Bruno Desthuilliers wrote: >> Disadvantages: your code is filled with line noise. It's an arbitrary >> choice between @@ meaning instance attribute and @@ meaning class >> attribute -- there's no logical reason for choosing one over the other, >> so you have to

Re: Confessions of a Python fanboy

2009-08-04 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Fri, 31 Jul 2009 13:38:56 +0200, Bruno Desthuilliers wrote: On the other hand, we don't have to prefix names with @ and @@, Nope, we have to prefix them with 'self' or 'cls' (or even 'self.__class__'). Incorrect. Correct for all relevant cases, except this one:

Re: Confessions of a Python fanboy

2009-07-31 Thread Emmanuel Surleau
On Saturday 01 August 2009 03:46:12 Steven D'Aprano wrote: > On Fri, 31 Jul 2009 20:41:12 +0200, Emmanuel Surleau wrote: > >> We don't actually *declare* that something is constant and then have > >> that declaration ignored. Python doesn't lie to us, although (as in any > >> language) a programmer

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Fri, 31 Jul 2009 20:41:12 +0200, Emmanuel Surleau wrote: >> We don't actually *declare* that something is constant and then have >> that declaration ignored. Python doesn't lie to us, although (as in any >> language) a programmer might. > > You could say that Ruby doesn't either, Well you co

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 20:17 , Steven D'Aprano wrote: On Fri, 31 Jul 2009 18:15:15 +0200, Masklinn wrote: I know, I know, Ruby people swear by anonymous code blocks, and I've read Paul Graham too. But I'm really not so sure that the benefits of anonymous code blocks are great enough to overcome the

Re: Confessions of a Python fanboy

2009-07-31 Thread Emmanuel Surleau
On Friday 31 July 2009 18:54:23 Tim Rowe wrote: > 2009/7/31 Steven D'Aprano : > > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > >> That and the fact that I couldn't stop laughing for long enough to learn > >> any more when I read in the Pragmatic Programmer's Guide that "Ruby, > >> unlike l

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Fri, 31 Jul 2009 18:15:15 +0200, Masklinn wrote: > > I know, I know, Ruby people swear by > > anonymous code blocks, and I've read Paul Graham too. But I'm really > > not so sure that the benefits of anonymous code blocks are great > > enough to overcome the disadvantages of anonymous code bloc

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 18:24 , Terry Reedy wrote: Masklinn wrote: #each is simply a method that takes a function (called blocks in ruby). One could call it a higher-order method I guess. It's an implementation of the concept of internal iteration: instead of collections yielding iterator objects

Re: Confessions of a Python fanboy

2009-07-31 Thread Falcolas
On Jul 31, 3:49 am, Masklinn wrote: > On 31 Jul 2009, at 10:25 , Chris Rebert wrote:> On Fri, Jul 31, 2009 at 1:21 > AM, Xavier Ho   > > wrote: > >> On Fri, Jul 31, 2009 at 6:08 PM, Masklinn   > >> wrote: > > >>> ... but since Python doesn't have anonymous functions that   > >>> usage > >>> tend

Re: Confessions of a Python fanboy

2009-07-31 Thread Tim Rowe
2009/7/31 Steven D'Aprano : > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > >> That and the fact that I couldn't stop laughing for long enough to learn >> any more when I read in the Pragmatic Programmer's Guide that "Ruby, >> unlike less flexible languages, lets you alter the value of a co

Re: Confessions of a Python fanboy

2009-07-31 Thread Terry Reedy
Masklinn wrote: #each is simply a method that takes a function (called blocks in ruby). One could call it a higher-order method I guess. It's an implementation of the concept of internal iteration: instead of collections yielding iterator objects, and programmers using those through speciall

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 17:55 , Steven D'Aprano wrote: But seriously, while I admit that I have very little Ruby experience, and so aren't in a great position to judge, it seems to me that Ruby doesn't have anything like Python's over-riding design principles (the Zen). If there is a design prin

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Fri, 31 Jul 2009 13:38:56 +0200, Bruno Desthuilliers wrote: >> On the other hand, we don't have to prefix names with @ and @@, > > Nope, we have to prefix them with 'self' or 'cls' (or even > 'self.__class__'). Incorrect. >>> class K: ... class_attribute = 'No @@ required.' ... >>> K().c

Re: Confessions of a Python fanboy

2009-07-31 Thread Benjamin Kaplan
On Fri, Jul 31, 2009 at 11:35 AM, Iain King wrote: > On Jul 31, 4:08 pm, Ethan Furman wrote: >> Steven D'Aprano wrote: >> > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: >> >> >>That and the fact that I couldn't stop laughing for long enough to learn >> >>any more when I read in the Pragmati

Re: Confessions of a Python fanboy

2009-07-31 Thread Iain King
On Jul 31, 4:08 pm, Ethan Furman wrote: > Steven D'Aprano wrote: > > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > > >>That and the fact that I couldn't stop laughing for long enough to learn > >>any more when I read in the Pragmatic Programmer's Guide that "Ruby, > >>unlike less flexible

Re: Confessions of a Python fanboy

2009-07-31 Thread Ethan Furman
Steven D'Aprano wrote: On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby, unlike less flexible languages, lets you alter the value of a constant." Yep,

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 15:12 , Bruno Desthuilliers wrote: Masklinn a écrit : On 31 Jul 2009, at 13:38 , Bruno Desthuilliers wrote: Steven D'Aprano a écrit : On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when

Re: Confessions of a Python fanboy

2009-07-31 Thread Bruno Desthuilliers
Masklinn a écrit : On 31 Jul 2009, at 13:38 , Bruno Desthuilliers wrote: Steven D'Aprano a écrit : On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby,

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 13:38 , Bruno Desthuilliers wrote: Steven D'Aprano a écrit : On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby, unlike less flexibl

Re: Confessions of a Python fanboy

2009-07-31 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby, unlike less flexible languages, lets you alter the value of a constant." Ye

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 11:54 , Iain King wrote: On Jul 31, 8:28 am, Steven D'Aprano wrote: On Thu, 30 Jul 2009 18:06:31 -0500, Robert Kern wrote: On 2009-07-30 16:44, r wrote: On Jul 30, 4:29 pm, Emmanuel Surleau wrote: 1.) No need to use "()" to call a function with no arguments. Python -->

Re: Confessions of a Python fanboy

2009-07-31 Thread Iain King
On Jul 31, 8:28 am, Steven D'Aprano wrote: > On Thu, 30 Jul 2009 18:06:31 -0500, Robert Kern wrote: > > On 2009-07-30 16:44, r wrote: > >> On Jul 30, 4:29 pm, Emmanuel Surleau wrote: > 1.) No need to use "()" to call a function with no arguments. Python > -->  "obj.m2().m3()" --ugly > >>

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 31 Jul 2009, at 10:25 , Chris Rebert wrote: On Fri, Jul 31, 2009 at 1:21 AM, Xavier Ho wrote: On Fri, Jul 31, 2009 at 6:08 PM, Masklinn wrote: ... but since Python doesn't have anonymous functions that usage tends to be a bit too verbose ... Sorry to interrupt, but wouldn't lambda

Re: Confessions of a Python fanboy

2009-07-31 Thread Jean-Michel Pichavant
r wrote: The purpose of his thread was to get feedback on how Python and Ruby ideas could be cumulated into the best high level language. And being that i am the BDFL of the "Confessions of a Python Fanboy" thread, you have my personal permission to continue on with this subj

Re: Confessions of a Python fanboy

2009-07-31 Thread Xavier Ho
On Fri, Jul 31, 2009 at 6:38 PM, Chris Rebert wrote: > No, because it has a name, namely "goBig"; this obviously prevents it > from being "anonymous". > > For comparison, note how the function in the following example is > never given a name, and is thus anonymous: > >>> (lambda x: x+5)(6) > 11 >

Re: Confessions of a Python fanboy

2009-07-31 Thread Chris Rebert
On Fri, Jul 31, 2009 at 1:31 AM, Xavier Ho wrote: > On Fri, Jul 31, 2009 at 6:25 PM, Chris Rebert wrote: >> >> I believe "full" anonymous functions was intended by the author. >> lambdas are limited to a single expression. "Full" anonymous functions >> would be allowed to contain multiple statemen

Re: Confessions of a Python fanboy

2009-07-31 Thread Xavier Ho
On Fri, Jul 31, 2009 at 6:25 PM, Chris Rebert wrote: > I believe "full" anonymous functions was intended by the author. > lambdas are limited to a single expression. "Full" anonymous functions > would be allowed to contain multiple statements. > > Cheers, but what about this: def goBig(x):

Re: Confessions of a Python fanboy

2009-07-31 Thread Chris Rebert
On Fri, Jul 31, 2009 at 1:21 AM, Xavier Ho wrote: > On Fri, Jul 31, 2009 at 6:08 PM, Masklinn wrote: >> >> ... but since Python doesn't have anonymous functions that usage >> tends to be a bit too verbose ... > > Sorry to interrupt, but wouldn't lambda in Python be considered as > 'anonymous func

Re: Confessions of a Python fanboy

2009-07-31 Thread Xavier Ho
On Fri, Jul 31, 2009 at 6:08 PM, Masklinn wrote: > ... but since Python doesn't have anonymous functions that usage > tends to be a bit too verbose ... > Sorry to interrupt, but wouldn't lambda in Python be considered as 'anonymous functions'? -- http://mail.python.org/mailman/listinfo/python-

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > That and the fact that I couldn't stop laughing for long enough to learn > any more when I read in the Pragmatic Programmer's Guide that "Ruby, > unlike less flexible languages, lets you alter the value of a constant." > Yep, as they say "Bug"

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 30 Jul 2009, at 23:57 , Luis Zarrabeitia wrote: I'd like to ask, what "container.each" is, exactly? It looks like a function call (as I've learned a few posts ago), but, what are its arguments? How the looping "works"? Does it receive a "code" object that it has to execute? Is .each some

Re: Confessions of a Python fanboy

2009-07-31 Thread Masklinn
On 30 Jul 2009, at 23:52 , Jan Kaliszewski wrote: Dnia 30-07-2009 o 22:41:57 Masklinn napisał(a): On 30 Jul 2009, at 22:23 , Jan Kaliszewski wrote: 30-07-2009 o 13:36:49 Masklinn wrote: On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 2.) the .each method container.e

Re: Confessions of a Python fanboy

2009-07-31 Thread Steven D'Aprano
On Thu, 30 Jul 2009 18:06:31 -0500, Robert Kern wrote: > On 2009-07-30 16:44, r wrote: >> On Jul 30, 4:29 pm, Emmanuel Surleau wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i

Re: Confessions of a Python fanboy

2009-07-30 Thread Emmanuel Surleau
On Friday 31 July 2009 01:06:31 Robert Kern wrote: > On 2009-07-30 16:44, r wrote: > > On Jul 30, 4:29 pm, Emmanuel Surleau > > > > wrote: > >>> 1.) No need to use "()" to call a function with no arguments. > >>> Python --> "obj.m2().m3()" --ugly > >>>Ruby --> "obj.m1.m2.m3" -- sweeet! > >>>

Re: Confessions of a Python fanboy

2009-07-30 Thread I V
On Thu, 30 Jul 2009 17:57:48 -0400, Luis Zarrabeitia wrote: > As I understood the question, it was "was wrong in 'for var in > container' in comparison with ruby's container.each?" > > What's the (semantic) difference between > > for localVar in container: > block > > and > > container.each

Re: Confessions of a Python fanboy

2009-07-30 Thread Terry Reedy
r wrote: On Jul 30, 3:55 pm, Terry Reedy wrote: superpollo wrote: r wrote: how to reverse a string in python? must i usa a temp? like: [snip] Terry Jan Reedy No "r" never wrote anything like that. reversing a string is RTFM material, this is basic stuff here! Stop quoting me as saying thin

Re: Confessions of a Python fanboy

2009-07-30 Thread Tim Rowe
2009/7/30 superpollo : > Tim Rowe wrote: >> Any language that gets any sort of real use has to have. For instance, >> I love Ada's numeric types (you can specify either the minimum number >> of significant figures or the maximum delta for a real type, and it >> will give you a type that satisfies

Re: Confessions of a Python fanboy

2009-07-30 Thread Robert Kern
On 2009-07-30 16:44, r wrote: On Jul 30, 4:29 pm, Emmanuel Surleau wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much cleaner. It ha

Re: Confessions of a Python fanboy

2009-07-30 Thread r
xt of this thread. The purpose of his thread was to get feedback on how Python and Ruby ideas could be cumulated into the best high level language. And being that i am the BDFL of the "Confessions of a Python Fanboy" thread, you have my personal permission to continue on with this subject matter..., -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-30 Thread Luis Zarrabeitia
On Thursday 30 July 2009 04:41:57 pm Masklinn wrote: > On 30 Jul 2009, at 22:23 , Jan Kaliszewski wrote: > > 30-07-2009 o 13:36:49 Masklinn wrote: > > > > I don't see any real limitation. What's wrong in: > > > > for localVar in container: > >block > > Well what's wrong with using that rather

Re: Confessions of a Python fanboy

2009-07-30 Thread Jan Kaliszewski
Dnia 30-07-2009 o 22:41:57 Masklinn napisał(a): On 30 Jul 2009, at 22:23 , Jan Kaliszewski wrote: 30-07-2009 o 13:36:49 Masklinn wrote: On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 2.) the .each method container.each{|localVar| block} This method can really clean

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 4:29 pm, Emmanuel Surleau wrote: > > 1.) No need to use "()" to call a function with no arguments. > > Python --> "obj.m2().m3()" --ugly > >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > > Man, i must admit i really like this, and your code will look so much > > cleaner. > > It has benefits -

Re: Confessions of a Python fanboy

2009-07-30 Thread Emmanuel Surleau
> 1.) No need to use "()" to call a function with no arguments. > Python --> "obj.m2().m3()" --ugly > Ruby --> "obj.m1.m2.m3" -- sweeet! > Man, i must admit i really like this, and your code will look so much > cleaner. It has benefits - code does look better. It has also significant cons - it

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 3:55 pm, Terry Reedy wrote: > superpollo wrote: > > r wrote: > > how to reverse a string in python? must i usa a temp? like: [snip] > Terry Jan Reedy No "r" never wrote anything like that. reversing a string is RTFM material, this is basic stuff here! Stop quoting me as saying things i

Re: Confessions of a Python fanboy

2009-07-30 Thread Terry Reedy
superpollo wrote: r wrote: how to reverse a string in python? must i usa a temp? like: >>> s = "ciccio" >>> l = list(s) >>> l.reverse() >>> s = "".join(l) >>> s 'oiccic' >>> ??? No. >>> ''.join(list(reversed('abc'))) 'cba' >>> 'abc'[2::-1] 'cba' >>> 'abc'[10::-1] 'cba' Any i

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 22:23 , Jan Kaliszewski wrote: 30-07-2009 o 13:36:49 Masklinn wrote: On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 2.) the .each method container.each{|localVar| block} This method can really cleanup some ugly for loops, although i really like t

Re: Confessions of a Python fanboy

2009-07-30 Thread Jan Kaliszewski
30-07-2009 o 13:36:49 Masklinn wrote: On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 2.) the .each method container.each{|localVar| block} This method can really cleanup some ugly for loops, although i really like the readability of for loops. map(lambda localVar: ,

Re: Confessions of a Python fanboy

2009-07-30 Thread superpollo
MRAB wrote: superpollo wrote: ... how to reverse a string in python? must i usa a temp? like: >>> s = "ciccio" >>> l = list(s) >>> l.reverse() >>> s = "".join(l) >>> s 'oiccic' >>> ??? Use slicing with a step of -1: >>> s = "ciccio" >>> s[::-1] 'oiccic' lol bye -- http://mail.py

Re: Confessions of a Python fanboy

2009-07-30 Thread Dave Angel
superpollo wrote: how to reverse a string in python? must i usa a temp? like: >>> s = "ciccio" >>> l = list(s) >>> l.reverse() >>> s = "".join(l) >>> s 'oiccic' >>> ??? bye simply s = s[::-1] DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 20:06 , Falcolas wrote: On Jul 30, 11:56 am, Masklinn wrote: On 30 Jul 2009, at 19:37 , Jean-Michel Pichavant wrote: r wrote: How do I know if foo.value is an attribute or if it is a method that returns the foo value ? It cannot be an attribute. Ruby doesn't give acces

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 20:05 , superpollo wrote: r wrote: On Jul 30, 12:15 pm, Masklinn wrote: [snip] Furthermore Ruby has a pretty nice convention (sadly not used enough I think) taken from Scheme where it's possible to postfix a method name with "!" (note: the "!" is part of the name, the

Re: Confessions of a Python fanboy

2009-07-30 Thread MRAB
superpollo wrote: r wrote: On Jul 30, 12:15 pm, Masklinn wrote: [snip] Furthermore Ruby has a pretty nice convention (sadly not used enough I think) taken from Scheme where it's possible to postfix a method name with "!" (note: the "!" is part of the name, there's no magic) to indicate t

Re: Confessions of a Python fanboy

2009-07-30 Thread superpollo
Tim Rowe wrote: 2009/7/30 r : Like your first lay, your first programing language can leave an indelible mark on you That's true. FOCAL scarred me for life. but i now realize Ruby has some good things going for it. Any language that gets any sort of real use has to have. For instance,

Re: Confessions of a Python fanboy

2009-07-30 Thread Falcolas
On Jul 30, 11:56 am, Masklinn wrote: > On 30 Jul 2009, at 19:37 , Jean-Michel Pichavant wrote: > > > r wrote: > > How do I know if foo.value is an attribute or if it is a method that   > > returns the foo value ? > > It cannot be an attribute. Ruby doesn't give access to attributes,   > they're a

Re: Confessions of a Python fanboy

2009-07-30 Thread superpollo
r wrote: On Jul 30, 12:15 pm, Masklinn wrote: [snip] Furthermore Ruby has a pretty nice convention (sadly not used enough I think) taken from Scheme where it's possible to postfix a method name with "!" (note: the "!" is part of the name, there's no magic) to indicate that this method mod

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 19:42 , Carsten Haese wrote: r wrote: Of course in python you would do... vector.reverse --> in-place vector.reversed --> in-place You do know that only one of those works in-place, right? Well mostly because the other one doesn't exist (as python has `lst.reverse()` bu

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 19:37 , Jean-Michel Pichavant wrote: r wrote: On Jul 30, 11:31 am, Falcolas wrote: On Jul 29, 9:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i reall

Re: Confessions of a Python fanboy

2009-07-30 Thread Tim Rowe
2009/7/30 r : > > Like your > first lay, your first programing language can leave an indelible mark > on you That's true. FOCAL scarred me for life. > but i now realize Ruby has some good > things going for it. Any language that gets any sort of real use has to have. For instance, I love Ada's n

Re: Confessions of a Python fanboy

2009-07-30 Thread Carsten Haese
r wrote: > Of course in python you would do... > vector.reverse --> in-place > vector.reversed --> in-place You do know that only one of those works in-place, right? > The above example works pretty good, but this doesn't always "sound" > good. Take for example this... > point3d.offset -->

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 12:37 pm, Jean-Michel Pichavant wrote: > r wrote: > > On Jul 30, 11:31 am, Falcolas wrote: > > >> On Jul 29, 9:06 pm, r wrote: > > >>> 1.) No need to use "()" to call a function with no arguments. > >>> Python --> "obj.m2().m3()" --ugly > >>>   Ruby --> "obj.m1.m2.m3"  -- sweeet! > >>

Re: Confessions of a Python fanboy

2009-07-30 Thread Jean-Michel Pichavant
r wrote: On Jul 30, 11:31 am, Falcolas wrote: On Jul 29, 9:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much clean

Re: Confessions of a Python fanboy

2009-07-30 Thread r
Traceback (most recent post last): File "", lines (13,14), in vector.reverse --> in-place vector.reversed --> in-place DumbMistakeError: Of course in python you would do... vector.reverse --> in-place vector.reversed --> new vector -- http://mail.python.org/mailman/listinfo/python-

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 12:15 pm, Masklinn wrote: [snip] > Furthermore Ruby has a pretty nice convention (sadly not used enough I   > think) taken from Scheme where it's possible to postfix a method name   > with "!" (note: the "!" is part of the name, there's no magic) to   > indicate that this method modifie

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 19:01 , Inky 788 wrote: On Jul 30, 12:04 am, alex23 wrote: On Jul 30, 1:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 18:31 , Falcolas wrote: On Jul 29, 9:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much cleaner. I perso

Re: Confessions of a Python fanboy

2009-07-30 Thread r
On Jul 30, 11:31 am, Falcolas wrote: > On Jul 29, 9:06 pm, r wrote: > > > 1.) No need to use "()" to call a function with no arguments. > > Python --> "obj.m2().m3()" --ugly > >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > > Man, i must admit i really like this, and your code will look so much > > cle

Re: Confessions of a Python fanboy

2009-07-30 Thread Inky 788
On Jul 30, 12:04 am, alex23 wrote: > On Jul 30, 1:06 pm, r wrote: > > > 1.) No need to use "()" to call a function with no arguments. > > Python --> "obj.m2().m3()" --ugly > >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > > Man, i must admit i really like this, and your code will look so much > > clean

Re: Confessions of a Python fanboy

2009-07-30 Thread Falcolas
On Jul 29, 9:06 pm, r wrote: > 1.) No need to use "()" to call a function with no arguments. > Python --> "obj.m2().m3()" --ugly >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > Man, i must admit i really like this, and your code will look so much > cleaner. I personally would not prefer this, and woul

Re: Confessions of a Python fanboy

2009-07-30 Thread Colin J. Williams
Some have treated this as a troll. I don't. r wrote: [snip] 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much cleaner. +1 2.) the .each me

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 14:03 , superpollo wrote: Masklinn wrote: ... That's an interesting point, but not relevant at the end of the day: `foo.length` and `length(foo)` have the same "practicality". On the other hand Ruby can be praised for the coherence: everything's a method period end of t

Re: Confessions of a Python fanboy

2009-07-30 Thread Jean-Michel Pichavant
superpollo wrote: Masklinn wrote: ... That's an interesting point, but not relevant at the end of the day: `foo.length` and `length(foo)` have the same "practicality". On the other hand Ruby can be praised for the coherence: everything's a method period end of the story; while Python does h

Re: Confessions of a Python fanboy

2009-07-30 Thread superpollo
Masklinn wrote: ... That's an interesting point, but not relevant at the end of the day: `foo.length` and `length(foo)` have the same "practicality". On the other hand Ruby can be praised for the coherence: everything's a method period end of the story; while Python does have a dichotomy be

Re: Confessions of a Python fanboy

2009-07-30 Thread Masklinn
On 30 Jul 2009, at 06:04 , alex23 wrote: On Jul 30, 1:06 pm, r wrote: 1.) No need to use "()" to call a function with no arguments. Python --> "obj.m2().m3()" --ugly Ruby --> "obj.m1.m2.m3" -- sweeet! Man, i must admit i really like this, and your code will look so much cleaner. How do you

Re: Confessions of a Python fanboy

2009-07-30 Thread Marco Mariani
r wrote: My adventures in Ruby. Oh, it's you. Good boy. Now, why don't you have a look at javascript and come back in six months? Or better yet, haskell and twelve months. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-29 Thread Carl Banks
On Jul 29, 9:04 pm, alex23 wrote: > On Jul 30, 1:06 pm, r wrote: > > > 1.) No need to use "()" to call a function with no arguments. > > Python --> "obj.m2().m3()" --ugly > >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > > Man, i must admit i really like this, and your code will look so much > > cleane

Re: Confessions of a Python fanboy

2009-07-29 Thread Chris Rebert
On Wed, Jul 29, 2009 at 9:04 PM, alex23 wrote: > On Jul 30, 1:06 pm, r wrote: >> 1.) No need to use "()" to call a function with no arguments. >> Python --> "obj.m2().m3()" --ugly >>   Ruby --> "obj.m1.m2.m3"  -- sweeet! >> Man, i must admit i really like this, and your code will look so much >> c

Re: Confessions of a Python fanboy

2009-07-29 Thread alex23
On Jul 30, 1:06 pm, r wrote: > 1.) No need to use "()" to call a function with no arguments. > Python --> "obj.m2().m3()" --ugly >   Ruby --> "obj.m1.m2.m3"  -- sweeet! > Man, i must admit i really like this, and your code will look so much > cleaner. How do you distinguish between calling a meth

Confessions of a Python fanboy

2009-07-29 Thread r
Hello fellow Pythonista's it's nice to be back after such a long hiatus. I have recently realized my blind love affair with Python was just that. I must admit there are better ways to program. Like your first lay, your first programing language can leave an indelible mark on you, but like all you