<div dir="ltr">On Wed, Jul 30, 2008 at 1:03 PM, Brett g Porter <span dir="ltr"><<a href="mailto:bgporter@acm.org">bgporter@acm.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Robert Dailey wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is an example of a response I'm looking for:<br>
"The self parameter is required because the parser is a bit old and needs to know the exact object you're referencing"<br>
<br>
This is _not_ an example of what I'm looking for:<br>
"Specifying self is a great mysterious thing that we should never question. Do not question the language! The language is mighty! Don't bring C++ to Python!"<br>
<br>
</blockquote>
<br></div>
Fredrik Lundh has written a  very clear explanation of this at <a href="http://effbot.org/pyfaq/why-must-self-be-used-explicitly-in-method-definitions-and-calls.htm" target="_blank">http://effbot.org/pyfaq/why-must-self-be-used-explicitly-in-method-definitions-and-calls.htm</a><br>

<br>
(or <a href="http://bit.ly/3EUiCf" target="_blank">http://bit.ly/3EUiCf</a> if you don't feel like stitching that URL back together...)<br></blockquote></div><br>This sounds like an article of opinion. He's not really given any reasons other than "Well, it makes this easier or look better". True that declarations are the determining factor in C/C++, however I was thinking of more or less an implied 'self'. For example:<br>
<br><span style="font-family: courier new,monospace;">
# Consider this normal syntax:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
class MyFoo:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
    def DoFoo( self ):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        self._member = 6</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># Elimintating 'self' in the parameter list should still work as far as the</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"># interpreter is concerned, since 'self' in this case now acts like 'this'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># in C++. The below code should be equivalent.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
class MyFoo:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
    def DoFoo():</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        self._member = 6</span><br><br>Given the code samples above, is there any technical reason why this cannot be done? Thanks for the input guys, and thanks more over for keeping this easy-going.<br></div>