Nathan Duran wrote:
On Apr 11, 2008, at 11:35 AM, [EMAIL PROTECTED] wrote:
I'd like to assign the value of an attribute in __init__ as the default
value of an argument in a method. See below:
Why not just do
def franklin(self, keyword):
if not keyword: keyword = self.default
Hi,
I'd like to assign the value of an attribute in __init__ as the default
value of an argument in a method. See below:
class aphorisms():
def __init__(self, keyword):
self.default = keyword
def franklin(self, keyword = self.default):
return A %s in time saves nine. %
Kevin Takacs wrote:
Hi,
I'd like to assign the value of an attribute in __init__ as the default
value of an argument in a method. See below:
class aphorisms():
def __init__(self, keyword):
self.default = keyword
def franklin(self, keyword = self.default):
On Apr 11, 7:20 pm, Kevin Takacs [EMAIL PROTECTED] wrote:
Hi,
I'd like to assign the value of an attribute in __init__ as the default
value of an argument in a method. See below:
class aphorisms():
def __init__(self, keyword):
self.default = keyword
def franklin(self,
On Apr 11, 2008, at 11:35 AM, [EMAIL PROTECTED] wrote:
I'd like to assign the value of an attribute in __init__ as the
default
value of an argument in a method. See below:
Are you sure? You will not get fresh values with each call in Python
as you would in other languages.
Why not just