Created
June 1, 2015 17:48
-
-
Save LeMeteore/73ce27f40346a42cd03c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass: | |
@staticmethod | |
def the_static_method(): | |
print("yeah") | |
@classmethod | |
def the_class_method(cls, x): | |
print("class: %s, arg x: %s" % (cls,x)) | |
class Person: | |
name = "" | |
nickname = "" | |
def __init__(self, name="", nickname=""): | |
self.name = name | |
self.nickname = nickname | |
@classmethod | |
def from_string(cls, name_string): | |
name, nickname = name_string.split(',') | |
person = cls(name, nickname) | |
return person |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment