TheFlyingDutchman wrote:
I am not talking about the way it does it, but rather, the way it
could do it or... could have done it. That requires no knowledge of
how the interpreter currently does it unless I am proposing something
that no interpreter in the world could ever do.
Yes, there
Ron Adam a écrit :
TheFlyingDutchman wrote:
I am not talking about the way it does it, but rather, the way it
could do it or... could have done it. That requires no knowledge of
how the interpreter currently does it unless I am proposing something
that no interpreter in the world could
Bruno Desthuilliers wrote:
Ron Adam a écrit :
TheFlyingDutchman wrote:
I am not talking about the way it does it, but rather, the way it
could do it or... could have done it. That requires no knowledge of
how the interpreter currently does it unless I am proposing something
that no
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Aahz a écrit :
In article [EMAIL PROTECTED],
Steve Holden [EMAIL PROTECTED] wrote:
Aahz wrote:
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Aahz a écrit :
In article [EMAIL
Aahz a écrit :
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
(snip)
(For those joining only recently, my full legal name is Aahz, which I
changed from my former name precisely because of attitudes like Bruno's.)
For the record, I usually don't give a damn about
Aahz a écrit :
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
But what, given that I'm an AOL user still thinking it's kewl to hide
behind a pseudo, what else would you expect ?
What exactly is a pseudo, pray tell?
Sorry : a pseudonym (a nickname).
--
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Aahz a écrit :
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
But what, given that I'm an AOL user still thinking it's kewl to hide
behind a pseudo, what else would you expect ?
What
Aahz wrote:
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Aahz a écrit :
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
But what, given that I'm an AOL user still thinking it's kewl to hide
behind a pseudo, what else would you
In article [EMAIL PROTECTED],
Steve Holden [EMAIL PROTECTED] wrote:
Aahz wrote:
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Aahz a écrit :
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
But what, given that I'm an AOL user still
Aahz a écrit :
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Aahz a écrit :
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
But what, given that I'm an AOL user still thinking it's kewl to hide
behind a pseudo, what else would you
Aahz a écrit :
In article [EMAIL PROTECTED],
Steve Holden [EMAIL PROTECTED] wrote:
Aahz wrote:
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Aahz a écrit :
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
But what, given that I'm
Ironic
Hi, I'm new to Python, I don't even fully know the language, never done
a full project in Python. What's more, probably I'll never will.
But that's not the point, the point is I want YOU people to modify the
language you know in and out, the program with which you've done many
The other half of the confusion is cleared up by considering that
Python methods are ordinary functions that don't magically know in
which class context they are executing: they must be told via the
first parameter.
They can be told all they want by the compiler/runtime - implicitly -
TheFlyingDutchman a écrit :
Ironic
Hi, I'm new to Python, I don't even fully know the language, never done
a full project in Python. What's more, probably I'll never will.
But that's not the point, the point is I want YOU people to modify the
language you know in and out, the program with
VivaLaFrance
If you wanna know why the Renault Dauphine requires the driver to pull
down on the rearview mirror in order to shift into reverse you simply
need to open the hood and remove the engine and disassemble the
transmission and you will see that it has no way of distinguishing a
shift into
Ben Finney wrote:
The latter two statements are equivalent. The 'instance.method(args)'
syntax is just sugar for 'Class.method(instance, args)'.
Only in the case that instance is an instance of Class, and not an
instance of a subclass of Class. For example, the following are not
equivalent:
TheFlyingDutchman a écrit :
VivaLaFrance
If you wanna know why the Renault Dauphine requires the driver to pull
down on the rearview mirror in order to shift into reverse you simply
need to open the hood and remove the engine and disassemble the
transmission and you will see that it has no
TheFlyingDutchman wrote:
The other half of the confusion is cleared up by considering that
Python methods are ordinary functions that don't magically know in
which class context they are executing: they must be told via the
first parameter.
They can be told all they want by the
On 9/13/07, Stefan Bellon [EMAIL PROTECTED] wrote:
On Thu, 13 Sep, TheFlyingDutchman wrote:
Bruce said that no other mainstream OO language is explicitly passing
the object as a parameter to class methods.
Ada 95 does. And Ada 95 was the first standardized OO language.
Now that's
Graham Dumpleton wrote:
...
In that blog, Guido says:
Concurrency: It seems we're now happily out exploring here. I'm
looking forward to benchmarks showing that PP or similar (or
dissimilar!) solutions actually provide a performance gain. Another
route I'd like to see explored is
On Sep 17, 4:02 am, Steve Holden [EMAIL PROTECTED] wrote:
TheFlyingDutchman wrote:
The other half of the confusion is cleared up by considering that
Python methods are ordinary functions that don't magically know in
which class context they are executing: they must be told via the
first
TheFlyingDutchman a écrit :
On Sep 17, 4:02 am, Steve Holden [EMAIL PROTECTED] wrote:
(snip)
I made a complaint about a small design choice.
It's by no mean a small design choice.
I also made it in the
past tense at least once (should have done it) and explicitly
expressed that I knew it
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
But what, given that I'm an AOL user still thinking it's kewl to hide
behind a pseudo, what else would you expect ?
What exactly is a pseudo, pray tell?
--
Aahz ([EMAIL PROTECTED]) *
John Roth a écrit :
On Sep 12, 11:35 am, TheFlyingDutchman [EMAIL PROTECTED] wrote:
On Sep 12, 4:40 am, Bjoern Schliessmann [EMAIL PROTECTED] wrote:
Ivan Voras wrote:
What does self have to do with an object model? It's an
function/method argument that might as well be hidden in the
compiler
Erik Jones a écrit :
On Sep 14, 2007, at 11:54 PM, David Trudgett wrote:
TheFlyingDutchman [EMAIL PROTECTED] writes:
(snip)
Several languages use the object.method(args) form, which is syntactic
sugar for method(object, other_args) which Ada, for instance, uses.
Knowing this clears up
On Sep 14, 2007, at 11:54 PM, David Trudgett wrote:
TheFlyingDutchman [EMAIL PROTECTED] writes:
The confusing way about the current Python method when you first
encounter it is
why is self being passed in when you write the function but not
when you call it. If the compiler is smart enough
Bjoern Schliessmann [EMAIL PROTECTED] wrote
in message news:[EMAIL PROTECTED]
| - only functions being attributes of a class...
|What, IYHO, is the difference between a method and a function?
A method is a function accessed as an attribute of a class or instance.
As an object type, it is a
Bjoern Schliessmann a écrit :
Bruno Desthuilliers wrote:
Bjoern Schliessmann a écrit :
Why don't you make a preprocessor which accepts method
declarations without self and fixes them?
The problem being that there's no such thing as a method
declaration in Python
Yep, there are only
Bruno Desthuilliers wrote:
A method is a thin wrapper around a function, usually instanciated
and returned by the __get__ method [1] of the function itself when
the function is looked up as an attribute of a class or an
instance:
[...]
That's interesting, thank you for the explanation.
Terry Reedy wrote:
No it does not. The method wrapping is done at runtine. The
compiler is ignorant of the wrapping that will be done.
Agreed, after reading the docs.
dis.dis(f)
1 0 LOAD_GLOBAL 0 (c)
3 LOAD_ATTR1 (meth)
Piet van Oostrum [EMAIL PROTECTED] wrote:
Ben Finney [EMAIL PROTECTED] (BF) wrote:
BF The latter two statements are equivalent. The
'instance.method(args)' BF syntax is just sugar for
'Class.method(instance, args)'.
It is more than just syntactic sugar because the Class is derived from
Bjoern Schliessmann [EMAIL PROTECTED] wrote
in message news:[EMAIL PROTECTED]
That's interesting. BTW, do you know something (apart from the dis
docs) that's worth reading if you're interested in Python byte
code?
--
That is the only Python specific thing I remember reading. Of
On Sep 12, 11:35 am, TheFlyingDutchman [EMAIL PROTECTED] wrote:
On Sep 12, 4:40 am, Bjoern Schliessmann [EMAIL PROTECTED] wrote:
Ivan Voras wrote:
What does self have to do with an object model? It's an
function/method argument that might as well be hidden in the
compiler without ever
On Sep 12, 1:35 pm, TheFlyingDutchman [EMAIL PROTECTED] wrote:
On Sep 12, 4:40 am, Bjoern Schliessmann [EMAIL PROTECTED] wrote:
Ivan Voras wrote:
What does self have to do with an object model? It's an
function/method argument that might as well be hidden in the
compiler without ever
Bruno Desthuilliers wrote:
TheFlyingDutchman a écrit :
Well I'm with Bruce Eckel - there shouldn't be any argument for the
object in the class method parameter list.
def fun(obj, *args, **kw):
# generic code here that do something with obj
import some_module
some_module.SomeClass.fun
TheFlyingDutchman [EMAIL PROTECTED] writes:
The confusing way about the current Python method when you first
encounter it is
why is self being passed in when you write the function but not
when you call it. If the compiler is smart enough to know that
a = MyClass()
TheFlyingDutchman a écrit :
On Sep 12, 4:40 am, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:
Ivan Voras wrote:
What does self have to do with an object model? It's an
function/method argument that might as well be hidden in the
compiler without ever touching the role it has (if not,
TheFlyingDutchman a écrit :
Foo.bar(foo, spam)
foo.bar(spam)
That looks like a case of There's more than one way to do it. ;)
Nope, on the contrary. The nice thing with this model is that you don't
have distinct rules for functions and methods, since methods are just
plain
TheFlyingDutchman [EMAIL PROTECTED] (T) wrote:
T The confusing way about the current Python method when you first
T encounter it is
T why is self being passed in when you write the function but not
T when you call it.
It *is* passed when you call it, but it is written before the method name
Ben Finney [EMAIL PROTECTED] (BF) wrote:
BF The latter two statements are equivalent. The 'instance.method(args)'
BF syntax is just sugar for 'Class.method(instance, args)'.
It is more than just syntactic sugar because the Class is derived from the
instance at runtime.
--
Piet van Oostrum
TheFlyingDutchman wrote:
I am not talking about how the implementation of a C++ or Java
compiler uses the this pointer/this reference internally. I am
talking about how an author describes in English the this
pointer/reference in their book on programming C++ or Java.
Ah, okay.
I don't
TheFlyingDutchman [EMAIL PROTECTED] wrote:
Foo.bar(foo, spam)
foo.bar(spam)
That looks like a case of There's more than one way to do it. ;)
The first form is definitely consistent with the
method declaration, so there's a lot to be said for using that style
when teaching
Well I'm with Bruce Eckel - there shouldn't be any argument for the
object in the class method parameter list. But since Python 3 was
code-named 3000 (implying but not delivering big changes... I don't
think it required big changes) and since it still has an explicit
object parameter it's a given
Here is a link to a tutorial where Sun is talking about the this
reference:
http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html
That's a tutorial for getting you started, no reference
documentation or in-depth course.
Here's a FAQ item where they refer to it as I think
TheFlyingDutchman wrote:
What I would like to have seen added to class definitions was the
forced declaration of all object variables in the class outside of
methods. I don't like the fact that they have to be, and can be
created in any method on the fly.
Isn't one of the main ideas behind
Isn't one of the main ideas behind python that it doesn't force you to
do (well, declare) anything? And by ideas I mean design decisions.
Thats exactly what makes python great for prototyping; you just do it
and see if it works. As soon as you need to declare things you have to
change stuff
On Thu, 13 Sep, TheFlyingDutchman wrote:
Bruce said that no other mainstream OO language is explicitly passing
the object as a parameter to class methods.
Ada 95 does. And Ada 95 was the first standardized OO language. Now
with Ada 2005 you can either pass the the object explicitly as first
On Thu, 13 Sep 2007 10:10:57 -0700, TheFlyingDutchman wrote:
Isn't one of the main ideas behind python that it doesn't force you to
do (well, declare) anything? And by ideas I mean design decisions.
Thats exactly what makes python great for prototyping; you just do it
and see if it works. As
TheFlyingDutchman a écrit :
Well I'm with Bruce Eckel - there shouldn't be any argument for the
object in the class method parameter list.
def fun(obj, *args, **kw):
# generic code here that do something with obj
import some_module
some_module.SomeClass.fun = fun
This is why uniformity is
(Can you tell I'm currently forced to developing in Java? ;) (Which I'm
currently avoiding to do, by wasting my time on usenet.))
Maybe you can sneak Jython into the mix. Just describe it as this
Java scripting language.
--
http://mail.python.org/mailman/listinfo/python-list
TheFlyingDutchman wrote:
Here's a FAQ item where they refer to it as I think Python should
have done it - a special predefined variable:
Maybe. Personally, I like it the way it is in Python.
Why don't you make a preprocessor which accepts method declarations
without self and fixes them?
TheFlyingDutchman wrote:
(Can you tell I'm currently forced to developing in Java? ;) (Which I'm
currently avoiding to do, by wasting my time on usenet.))
Maybe you can sneak Jython into the mix. Just describe it as this
Java scripting language.
Hehe, devious idea. I might just try
Bjoern Schliessmann a écrit :
TheFlyingDutchman wrote:
Here's a FAQ item where they refer to it as I think Python should
have done it - a special predefined variable:
Maybe. Personally, I like it the way it is in Python.
Why don't you make a preprocessor which accepts method
TheFlyingDutchman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Here's a FAQ item where they refer to it as I think Python should have
| done it - a special predefined variable:
|
| http://www.faqs.org/docs/javap/c5/s5.html
|
| Java provides a special, predefined variable named
Bruno Desthuilliers wrote:
Bjoern Schliessmann a écrit :
Why don't you make a preprocessor which accepts method
declarations without self and fixes them?
The problem being that there's no such thing as a method
declaration in Python
Yep, there are only definitions. I'm sorry.
- only
On Thu, 13 Sep 2007 20:59:06 +0200, Bjoern Schliessmann wrote:
TheFlyingDutchman wrote:
Here's a FAQ item where they refer to it as I think Python should have
done it - a special predefined variable:
Maybe. Personally, I like it the way it is in Python.
Why don't you make a preprocessor
In article [EMAIL PROTECTED],
Ben Finney [EMAIL PROTECTED] wrote:
Specifically an easier way of doing it provided by the language syntax
(hence syntactic sugar). As in, the form 'foo += 1' is syntactic
sugar for 'foo = foo + 1'.
Except, of course, that it isn't, quite. ;-)
--
Aahz ([EMAIL
In article [EMAIL PROTECTED],
Alex Martelli [EMAIL PROTECTED] wrote:
Chris Mellon [EMAIL PROTECTED] wrote:
and I'll punch a kitten before I accept having to read
Python code guessing if something is a global, a local, or part of
self like I do in C++.
Exactly: the technical objections that
If you look at the thread parameter list notation from ten days or so
ago, TheFlyingDutchman has forked Python and is working on a very special
new language, PIEthun 3.01B.
I for one am looking forward to seeing all
the very special features of PIEthun.
It will be named PIEthun 3000 as it
TheFlyingDutchman a écrit :
Python user and advocate Bruce Eckel is disappointed with the
additions (or lack of additions) in Python 3:
http://www.artima.com/weblogs/viewpost.jsp?thread=214112
I'd say Mr Eckel fails to graps some of the great points about Python's
object model - the rant
Bruno Desthuilliers wrote:
TheFlyingDutchman a écrit :
Python user and advocate Bruce Eckel is disappointed with the
additions (or lack of additions) in Python 3:
http://www.artima.com/weblogs/viewpost.jsp?thread=214112
I'd say Mr Eckel fails to graps some of the great points about Python's
Ivan Voras wrote:
What does self have to do with an object model? It's an
function/method argument that might as well be hidden in the
compiler without ever touching the role it has (if not, why?). I
agree that it's needless noise in a language.
If this was needless, why do C++ and Java have
Bjoern Schliessmann wrote:
What does self have to do with an object model? It's an
function/method argument that might as well be hidden in the
compiler without ever touching the role it has (if not, why?). I
agree that it's needless noise in a language.
If this was needless, why do C++ and
Ivan Voras [EMAIL PROTECTED] wrote:
I'd say Mr Eckel fails to graps some of the great points about
Python's
object model - the rant about the use of 'self' is a sure clue.
What does self have to do with an object model? It's an
function/method argument that might as well be hidden in
Duncan Booth [EMAIL PROTECTED] wrote:
...
As for omitting 'self' from method definitions, at first site you might
think the compiler could just decide that any 'def' directly inside a
class could silently insert 'self' as an additional argument. This
doesn't work though because not
On 9/12/07, Alex Martelli [EMAIL PROTECTED] wrote:
Duncan Booth [EMAIL PROTECTED] wrote:
...
As for omitting 'self' from method definitions, at first site you might
think the compiler could just decide that any 'def' directly inside a
class could silently insert 'self' as an additional
Chris Mellon [EMAIL PROTECTED] wrote:
...
Actually you could do the magic first-parameter insertion just when
returning a bound or unbound method object in the function's __get__
special method, and that would cover all of the technical issues you
...
This would mean that mixing
On Sep 12, 4:40 am, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:
Ivan Voras wrote:
What does self have to do with an object model? It's an
function/method argument that might as well be hidden in the
compiler without ever touching the role it has (if not, why?). I
agree that it's
this in C++ and Java is not shown in the parameter list, which was
what he was
complaining about. He wants
class MyClass:
def SomeFunction(someParameter):
self.someParameter = someParameter
not
class MyClass:
def SomeFunction(self, someParameter):
TheFlyingDutchman wrote:
In C++ and Java I don't believe this is ever referred to as an
implicit function parameter.
Oh yes, it is. All methods use it as a base address into instances.
Implicitly though.
It is a (sometimes necessary) way to reference the object inside
one if it's methods.
Stefan Behnel wrote:
Bjoern Schliessmann wrote:
If this was needless, why do C++ and Java have the this
pointer?
Be careful when you use the word needless in the context of
Java.
Umm, why? I didn't introduce it.
Regards,
Björn
--
BOFH excuse #8:
static buildup
--
On Sep 12, 3:53 pm, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:
TheFlyingDutchman wrote:
In C++ and Java I don't believe this is ever referred to as an
implicit function parameter.
Oh yes, it is. All methods use it as a base address into instances.
Implicitly though.
I am not
TheFlyingDutchman [EMAIL PROTECTED] writes:
I am talking about how an author describes in English the this
pointer/reference in their book on programming C++ or Java.
I don't think you will find them saying that under the covers this
was passed to the method (if in fact it is). They just
On Sep 12, 5:47 pm, Ben Finney [EMAIL PROTECTED]
wrote:
TheFlyingDutchman [EMAIL PROTECTED] writes:
I am talking about how an author describes in English the this
pointer/reference in their book on programming C++ or Java.
I don't think you will find them saying that under the covers this
On 9/12/07, Ben Finney [EMAIL PROTECTED] wrote:
TheFlyingDutchman [EMAIL PROTECTED] writes:
I am talking about how an author describes in English the this
pointer/reference in their book on programming C++ or Java.
I don't think you will find them saying that under the covers this
was
TheFlyingDutchman [EMAIL PROTECTED] writes:
I would mention that an instance is passed as the first parameter
argument of a method if the methods were declared with the extra
argument and called with the extra argument:
a = MyClass()
my_method(a,someParameter)
Are you unaware that this
Peter Decker [EMAIL PROTECTED] writes:
On 9/12/07, Ben Finney [EMAIL PROTECTED] wrote:
How is that preferable to the magic of instance is passed as the
first argument to a method?
So everything that isn't passed explicitly is magic?
No. Everything that's not explicit is magic, in that it
Foo.bar(foo, spam)
foo.bar(spam)
That looks like a case of There's more than one way to do it. ;)
The first form is definitely consistent with the
method declaration, so there's a lot to be said for using that style
when teaching people to make classes - send self, receive self.
On Wed, 12 Sep 2007 19:40:04 -0700, TheFlyingDutchman wrote:
Foo.bar(foo, spam)
foo.bar(spam)
That looks like a case of There's more than one way to do it. ;) The
first form is definitely consistent with the method declaration, so
there's a lot to be said for using that style
TheFlyingDutchman [EMAIL PROTECTED] writes:
(Please, preserve attribution lines so it's clear who wrote what in
your quoted material.)
Foo.bar(foo, spam)
foo.bar(spam)
That looks like a case of There's more than one way to do it. ;)
Indeed, but there's only one *obvious* way to
Python user and advocate Bruce Eckel is disappointed with the
additions (or lack of additions) in Python 3:
http://www.artima.com/weblogs/viewpost.jsp?thread=214112
--
http://mail.python.org/mailman/listinfo/python-list
TheFlyingDutchman [EMAIL PROTECTED] writes:
Python user and advocate Bruce Eckel is disappointed with the
additions (or lack of additions) in Python 3:
http://www.artima.com/weblogs/viewpost.jsp?thread=214112
That article is pretty weak.
--
Paul Rubin http://[EMAIL PROTECTED] writes:
TheFlyingDutchman [EMAIL PROTECTED] writes:
Python user and advocate Bruce Eckel is disappointed with the
additions (or lack of additions) in Python 3:
http://www.artima.com/weblogs/viewpost.jsp?thread=214112
That article is pretty weak.
On Sep 12, 2:14 pm, Ben Finney [EMAIL PROTECTED]
wrote:
Paul Rubin http://[EMAIL PROTECTED] writes:
TheFlyingDutchman [EMAIL PROTECTED] writes:
Python user and advocate Bruce Eckel is disappointed with the
additions (or lack of additions) in Python 3:
84 matches
Mail list logo