Re: Use empty string for self
- From: roy@xxxxxxxxx (Roy Smith)
- Date: Wed, 1 Mar 2006 15:41:30 +0000 (UTC)
John Salerno <johnjsal@xxxxxxxxxxxxxxx> wrote:
I do get it. I think I will just have to get used to seeing the 'self'
argument but understanding that it's not really something that is always
passed in. I'm trying to train myself to see
def doittoit(self) as def doittoit()
That's OK as far as using your C++ experience to help understand
Python by analogy, but don't fall into the trap of trying to write C++
in Python.
.
Relevant Pages
- text adventure question
... I am working on a text adventure game for python to get back into ... def character_sheet: ... global reputation ... print "Please choose another command. ... (comp.lang.python) - Re: noob question: "TypeError" wrong number of args
... or it's newer syntactic-sugar-version would become somewhat more ... Python source code and outputs the same source code with only one change: ... insert the string 'self" as the first parameter of every "def ... Python code, which is unavoidable for such a syntactic change. ... (comp.lang.python) - Re: Python 3K or Python 2.9?
... function/method argument that might as well be hidden in the compiler ... You could add some syntax to Python such that '.x' was equivalent to ... def factory: ... C.method = foo ... (comp.lang.python) - Re: Different execution time in python code between embedded or standalone
... embedding python language, it's a middleware for dispatch and execute python ... def handler_alrm: ... run this in embedded mode md5challenge reached about 200.000 more keys!!! ... Usually it's easier to measure the time it takes to compute a long task (let's say, how much time it takes to compute 1000000 md5 values). ... (comp.lang.python) - Crude statistics on the standard library
... def browse_stdlib: ... # remove some obsolete modules ('this' + DeprecationWarning) ... Parts of output of python -i statsmod.py ... referrers of __future__ ... (comp.lang.python) |
|