I’m relatively new to Python and just getting my feet wet so things strike me and then take a while to sink in. I just realized that whne creating a class in python that by declaring the set method- for example:
def setName(self,name):
self.name=name (this should be indented)
within my class. The name property is automagically created. This can easily be a great time saver if you’re listing 20,30 ..1000 properties in a project.
I’m still a bit gauche with the lack of parentheses and using whitespace to represent block structure but I’m still green enough where I’m slow anyway and it doesn’t matter.
Another great thing is that even the basic python editor(IDLE) recognizes your classes and provides you with the docs of what fits in and the code hints as you are typing.
Discussion
No comments for “More Newbie Python goodness”
Post a comment