Skip to content

Instantly share code, notes, and snippets.

@cocuh
Last active December 22, 2015 01:59
Show Gist options
  • Select an option

  • Save cocuh/6400260 to your computer and use it in GitHub Desktop.

Select an option

Save cocuh/6400260 to your computer and use it in GitHub Desktop.
ゆきちせんせいじぇねれーたほしい
class Yukichi:
num = 0
def __init__(self):
self.hakkou_bangou=self._gen_id()
@classmethod
def _gen_id(cls):
cls.num += 1
return cls.num
def __str__(self):
return "yukichi_sensei"
def __int__(eslf):
return 10000
def gen_yukichi():
while True:
yield Yukichi()
gen = gen_yukichi()
gen.next()
gen.next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment