Re: Prototype OO

2008-04-03 Thread sam
[EMAIL PROTECTED] napisał(a): So, while I often use Python's lambdas, the imposed limitations is ok to me since I wouldn't use it for anything more complex. Also - as a side note - while the syntax is a bit different, the resulting object is an ordinary function. And people start asking

Re: Prototype OO

2008-04-03 Thread sam
Gabriel Genellina napisał(a): Yes. Funciton is always a piece of code (program) that does something. There is no need for different syntax. Guido has regretted lambda for a long time; it was scheduled for deletion on Python 3000 [2] but finally will stay [3]. Thanks for that info and

Re: Prototype OO

2008-04-03 Thread Diez B. Roggisch
And I say syntax should be the same. These are only opinions, so forgive me for wasting your time. You mean like in JS? function foo(args) {} foo = function(args) {} Somehow the JS-designers also made a compromise to allow to create unnamed and named functions. Could it be that it make

Re: Prototype OO

2008-04-03 Thread Bruno Desthuilliers
sam a écrit : [EMAIL PROTECTED] napisał(a): So, while I often use Python's lambdas, the imposed limitations is ok to me since I wouldn't use it for anything more complex. Also - as a side note - while the syntax is a bit different, the resulting object is an ordinary function. And

Re: Prototype OO

2008-04-03 Thread olive
On 3 avr, 10:32, sam [EMAIL PROTECTED] wrote: Bruno Desthuilliers napisa³(a): Ok, I'm going to be a bit harsh, but this time I'll assume it. Sam, you started this thread by asking about prototype vs class based minor syntactic points that, whether you like them or not (and I think I will

Re: Prototype OO

2008-04-03 Thread Bruno Desthuilliers
sam a écrit : Bruno Desthuilliers napisał(a): Ok, I'm going to be a bit harsh, but this time I'll assume it. Sam, you started this thread by asking about prototype vs class based minor syntactic points that, whether you like them or not (and I think I will get back to this discussion

Re: Prototype OO

2008-04-03 Thread sam
Bruno Desthuilliers napisał(a): Ok, I'm going to be a bit harsh, but this time I'll assume it. Sam, you started this thread by asking about prototype vs class based minor syntactic points that, whether you like them or not (and I think I will get back to this discussion after learning

Re: Prototype OO

2008-04-03 Thread Marc 'BlackJack' Rintsch
On Thu, 03 Apr 2008 10:07:38 +0200, sam wrote: [EMAIL PROTECTED] napisał(a): So, while I often use Python's lambdas, the imposed limitations is ok to me since I wouldn't use it for anything more complex. Also - as a side note - while the syntax is a bit different, the resulting object

Re: Prototype OO

2008-04-03 Thread Gabriel Genellina
En Thu, 03 Apr 2008 05:20:48 -0300, sam [EMAIL PROTECTED] escribió: Gabriel Genellina napisał(a): Class methods and instance methods are not just standard functions; instance methods were plain functions before 2.2 and the Class object was in charge of doing the self magic. Now the

Re: Prototype OO

2008-04-03 Thread Larry Bates
On Wed, 2008-04-02 at 21:03 -0700, [EMAIL PROTECTED] wrote: On Apr 2, 5:41 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 2 avr, 22:23, Paul Rubin http://[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] writes: Fine. But totally irrelevant here - this is

Re: Prototype OO

2008-04-02 Thread sam
Bruno Desthuilliers napisał(a): Sam, seriously, why don't start with *learning* about Python's object model ? Seriously ? Not that it's perfect, not that you have to like it Ok -- thank you for your time and your strong opinions about current solutions. --

Re: Prototype OO

2008-04-02 Thread sam
Gabriel Genellina napisał(a): 1. You have different syntax for named and unnamed (lambdas) functions. Functions and methods are different things in Python even if they have same syntax. But all these are still a pieces of code that you use repeatedly to make some task. A knife and scissors

Re: Prototype OO

2008-04-02 Thread Bruno Desthuilliers
sam a écrit : Bruno Desthuilliers napisał(a): Sam, seriously, why don't start with *learning* about Python's object model ? Seriously ? Not that it's perfect, not that you have to like it Ok -- thank you for your time and your strong opinions about current solutions. Don't

Re: Prototype OO

2008-04-02 Thread sam
Bruno Desthuilliers napisał(a): Don't misunderstand me : I'm not saying that class-based is better (or worse) than prototype, I'm not saying that Python is perfect, I'm not saying that your points are not worth any consideration, I'm just saying that, from your arguments, I have the very

Re: Prototype OO

2008-04-02 Thread Carl Banks
On Apr 2, 10:52 am, sam [EMAIL PROTECTED] wrote: Then I say: -- __id is awful, because it is a trick to prefix names and gurus say: -- it is good solution for name conflicts But somebody may prefix his names with class names and cause nameconflict, so maybe it is not so

Re: Prototype OO

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 16:52, sam [EMAIL PROTECTED] wrote: Bruno Desthuilliers napisał(a): Don't misunderstand me : I'm not saying that class-based is better (or worse) than prototype, I'm not saying that Python is perfect, I'm not saying that your points are not worth any consideration, I'm just

Re: Prototype OO

2008-04-02 Thread Paul Rubin
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: Here the problem is more philosophical than anything else. Python's philosophy is that most programmers are responsible and normally intelligent, so treating them all like retarted dummies because someone might one day do something stupid is just

Re: Prototype OO

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 20:46, Paul Rubin http://[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] writes: Here the problem is more philosophical than anything else. Python's philosophy is that most programmers are responsible and normally intelligent, so treating them all like retarted

Re: Prototype OO

2008-04-02 Thread Paul Rubin
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: Fine. But totally irrelevant here - this is comp.lang.python, not comp.lang.c, and we *do not* (I repeat : we *do not*) face the same safety and security problems as those existing in C. We have it better than they do in some ways. In some other

Re: Prototype OO

2008-04-02 Thread Gabriel Genellina
En Wed, 02 Apr 2008 09:23:21 -0300, sam [EMAIL PROTECTED] escribió: Gabriel Genellina napisał(a): 1. You have different syntax for named and unnamed (lambdas) functions. Functions and methods are different things in Python even if they have same syntax. But all these are still a pieces of

Re: Prototype OO

2008-04-02 Thread [EMAIL PROTECTED]
On 2 avr, 22:23, Paul Rubin http://[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] writes: Fine. But totally irrelevant here - this is comp.lang.python, not comp.lang.c, and we *do not* (I repeat : we *do not*) face the same safety and security problems as those existing in C.

Re: Prototype OO

2008-04-02 Thread castironpi
On Apr 2, 5:41 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 2 avr, 22:23, Paul Rubin http://[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] writes: Fine. But totally irrelevant here - this is comp.lang.python, not comp.lang.c, and we *do not* (I repeat : we *do not*)

Re: Prototype OO

2008-04-01 Thread Bruno Desthuilliers
sam a écrit : Steven D'Aprano napisał(a): I can see that Python and Javascript inheritance model is almost the same. Both languages are dynamically typed. And it seems that using classes in Python makes some things more complicated then it is necessary (eg functions, methods and lambdas are

Re: Prototype OO

2008-03-31 Thread sam
Diez B. Roggisch napisał(a): no inheritance model in Javascript. Or why does each JS-lib provide it's own version of an extend-function [1]? Ok -- thank you! The only point you might have is the somwhat unfortunate distinction between lambda and function in python - but this is on a

Re: Prototype OO

2008-03-31 Thread sam
Steven D'Aprano napisał(a): I can see that Python and Javascript inheritance model is almost the same. Both languages are dynamically typed. And it seems that using classes in Python makes some things more complicated then it is necessary (eg functions, methods and lambdas are differen beeing

Re: Prototype OO

2008-03-31 Thread Steve Holden
sam wrote: Steven D'Aprano napisał(a): I can see that Python and Javascript inheritance model is almost the same. Both languages are dynamically typed. And it seems that using classes in Python makes some things more complicated then it is necessary (eg functions, methods and lambdas are

Re: Prototype OO

2008-03-31 Thread sam
Steve Holden napisał(a): 1. You have different syntax for named and unnamed (lambdas) functions. Functions and methods are different things in Python even if they have same syntax. But all these are still a pieces of code that you use repeatedly to make some task. A knife and scissors

Re: Prototype OO

2008-03-31 Thread Gabriel Genellina
En Mon, 31 Mar 2008 07:59:13 -0300, sam [EMAIL PROTECTED] escribió: Steve Holden napisał(a): 1. You have different syntax for named and unnamed (lambdas) functions. Functions and methods are different things in Python even if they have same syntax. But all these are still a pieces of code

Re: Prototype OO

2008-03-26 Thread castironpi
On Mar 26, 3:14 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Wed, 26 Mar 2008 02:03:24 -0300, Gabriel Genellina [EMAIL PROTECTED] declaimed the following in comp.lang.python: No:http://en.wikipedia.org/wiki/Saruman Ask him any time over. --

Re: Prototype OO

2008-03-26 Thread Bruno Desthuilliers
sam a écrit : Bruno Desthuilliers napisał(a): In dynamically typed language when you create object A that is inherited from another object B, than object A knows that B is his predecessor. So when you reference A.prop, then prop is looked in A first, then in B, then in predecessors of

RE: Prototype OO

2008-03-25 Thread Delaney, Timothy (Tim)
John Machin wrote: On Mar 23, 12:32 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: John Machin schrieb: On Mar 21, 11:48 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: [1] Just one example:http://docs.mootools.net/Class/Class.js Mootools being something a coworker might use? I don't

Re: Prototype OO

2008-03-25 Thread castironpi
On Mar 25, 11:24 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Wed, 26 Mar 2008 06:49:57 +0800, Delaney, Timothy (Tim) [EMAIL PROTECTED] declaimed the following in comp.lang.python: As an aside, having lived much of my early life on a hobby farm, I've often wondered to myself just

Re: Prototype OO

2008-03-25 Thread Gabriel Genellina
En Wed, 26 Mar 2008 01:27:15 -0300, [EMAIL PROTECTED] escribió: On Mar 25, 11:24 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Wed, 26 Mar 2008 06:49:57 +0800, Delaney, Timothy (Tim) [EMAIL PROTECTED] declaimed the following in comp.lang.python: As an aside, having lived much of my early

Re: Prototype OO

2008-03-22 Thread Diez B. Roggisch
John Machin schrieb: On Mar 21, 11:48 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: [1] Just one example:http://docs.mootools.net/Class/Class.js Mootools being something a coworker might use? I don't understand the question. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Prototype OO

2008-03-22 Thread John Machin
On Mar 23, 12:32 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: John Machin schrieb: On Mar 21, 11:48 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: [1] Just one example:http://docs.mootools.net/Class/Class.js Mootools being something a coworker might use? I don't understand the

Re: Prototype OO

2008-03-21 Thread Bruno Desthuilliers
sam a écrit : Bruno Desthuilliers napisał(a): Most of the arguments in favor of prototypes seems to come to, mainly: 1/ it lets you customize behaviour on a per-object base 2/ it removes the mental overhead of inheritance, classes etc Point 1. is a non-problem in Python, since you can

Re: Prototype OO

2008-03-21 Thread sam
Bruno Desthuilliers napisał(a): In dynamically typed language when you create object A that is inherited from another object B, than object A knows that B is his predecessor. So when you reference A.prop, then prop is looked in A first, then in B, then in predecessors of B, and so on.

Re: Prototype OO

2008-03-21 Thread Steven D'Aprano
On Fri, 21 Mar 2008 11:43:33 +0100, sam wrote: I can see that Python and Javascript inheritance model is almost the same. Both languages are dynamically typed. And it seems that using classes in Python makes some things more complicated then it is necessary (eg functions, methods and lambdas

Re: Prototype OO

2008-03-21 Thread Diez B. Roggisch
I can see that Python and Javascript inheritance model is almost the same. Both languages are dynamically typed. And it seems that using classes in Python makes some things more complicated then it is necessary (eg functions, methods and lambdas are differen beeing in Python concept).

Re: Prototype OO

2008-03-21 Thread John Machin
On Mar 21, 11:48 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: [1] Just one example:http://docs.mootools.net/Class/Class.js Mootools being something a coworker might use? -- http://mail.python.org/mailman/listinfo/python-list

Re: Prototype OO

2008-03-20 Thread Bruno Desthuilliers
sam a écrit : Some time ago (2004) there were talks about prototype-based languages and Prothon emerged. Can someone tell me why class-based OO is better that Prototype based, For which definition of better ?-) especially in scripting langage with dynamic types as Python is? Here

Re: Prototype OO

2008-03-20 Thread sam
Bruno Desthuilliers napisał(a): Most of the arguments in favor of prototypes seems to come to, mainly: 1/ it lets you customize behaviour on a per-object base 2/ it removes the mental overhead of inheritance, classes etc Point 1. is a non-problem in Python, since you can already add/replace

Prototype OO

2008-03-19 Thread sam
Some time ago (2004) there were talks about prototype-based languages and Prothon emerged. Can someone tell me why class-based OO is better that Prototype based, especially in scripting langage with dynamic types as Python is? Here are some links:

Re: Prototype OO

2008-03-19 Thread Marc 'BlackJack' Rintsch
On Wed, 19 Mar 2008 17:59:40 +0100, sam wrote: Can someone tell me why class-based OO is better that Prototype based, especially in scripting langage with dynamic types as Python is? Is it better!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list