On Mon, Nov 1, 2010 at 2:18 PM, <brad...@hotmail.com> wrote: > Sorry that is what I mean. What is it for? > Sent wirelessly from my BlackBerry. >
What is what for? There is no boiler plate on variable names. *BY CONVENTION*, variables and methods with a special meaning will start and end with two underscores. *BY CONVENTION* something that you want to identify as an internal variable (what would be private in languages that enforce this) is prefixed with a single underscore. But neither of these are actually enforced by the language. For instance, an object's doc-string is stored as it's __doc__ attribute. The constructor is the __init__ method. The method that controls attribute access (which you can override) is __getattr__. Using str(object) to get the string representation works by calling the object's __str__ method. a + b is the same thing as a.__add__(b) > -----Original Message----- > From: MRAB <pyt...@mrabarnett.plus.com> > Sender: python-list-bounces+bradenf=hotmail....@python.org > Date: Mon, 01 Nov 2010 17:33:22 > To: <python-list@python.org> > Reply-To: python-list@python.org > Subject: Re: [Beginer Question] I heard about python needing some > sort of_VariableName_ boiler plate? > > On 01/11/2010 04:51, Ben Finney wrote: >> brad...@hotmail.com writes: >> >>> Sorry, to clarify I heard that when you declare a variable in python >>> you have to use some sort of standard boiler plate _variable_ however >>> this has not been my experience using IDLE so is this even true? >> >> I don't know what “some sort of boiler plate _variable_” might mean. >> >> Can you point to someone's actual message saying this, so we can see >> what they might be talking about? >> > Perhaps the OP means: > > if __name__ == "__main__": > ... > > although the "declare a variable" bit has me puzzled. > -- > http://mail.python.org/mailman/listinfo/python-list > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list