Skip to content

Instantly share code, notes, and snippets.

@ZoeyYoung
Created June 9, 2013 11:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZoeyYoung/5743220 to your computer and use it in GitHub Desktop.
Save ZoeyYoung/5743220 to your computer and use it in GitHub Desktop.
Python: 类注释模板,取自Google Python Style Guide
class SampleClass(object):
"""Summary of class here.
Longer class information....
Longer class information....
Attributes:
likes_spam: A boolean indicating if we like SPAM or not.
eggs: An integer count of the eggs we have laid.
"""
def __init__(self, likes_spam=False):
"""Inits SampleClass with blah."""
self.likes_spam = likes_spam
self.eggs = 0
def public_method(self):
"""Performs operation blah."""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment