i am developing in Python 3, i have a method with an argument of my class Color, however when i try to use a method:
def __init__(self, name, color=Color.Color("none"), style="solid", width="1px"):
self.__name = name
self.__style = style
self.__width = width
if color.get_name() == "none":
color.color_by_name('Black')
This is the error:
File ................, line 10, in __init__
if color.get_name() == "none":
AttributeError: 'str' object has no attribute 'get_name'
Color.Color()
isn't a class, but a method that returns a string. Am i right? – aIKid Oct 23 '13 at 16:32Color
Class? – aIKid Oct 23 '13 at 16:33color
is a string. Perhaps the default value is a string, or the argument passed in some specific case is a string. – delnan Oct 23 '13 at 16:34name
orstyle
. – Brian Cain Oct 23 '13 at 18:39