パスワードを忘れた? アカウント作成
171335 journal

Livingdeadの日記: Pythonのコード規約

日記 by Livingdead

コード規約というかスタイル上のガイドラインというか。
某掲示板で話題にあがっていたのだが、自分も前から気になっていた。
特に __author__ とか __version__ とか __date__ とか。
あと __doc__ (docstring) の中身の書き方とか。
まず某掲示板でリンクされていたのがこれ。

How do I organize my modules (source files)?

__author__ = "Rob Knight, Gavin Huttley, and Peter Maxwell"
__copyright__ = "Copyright 2007, The Cogent Project"
__credits__ = ["Rob Knight", "Peter Maxwell", "Gavin Huttley", "Matthew Wakefield"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "Rob Knight"
__email__ = "rob@spot.colorado.edu"
__status__ = "Production"

Status should typically be one of "Prototype", "Development", or "Production". __maintainer__ should be the person who will fix bugs and make improvements if imported. __credits__ differs from __author__ in that __credits__ includes people who reported bug fixes, made suggestions, etc. but did not actually write the code.
Python Coding Guidelines

docstring (__doc__)のスタイルなど関連するPEP文書としては

This document gives coding conventions for the Python code comprising the standard library in the main Python distribution.
PEP 8 -- Style Guide for Python Code

の他
PEP 256 -- Docstring Processing System FrameworkPEP 257 -- Docstring ConventionsPEP 258 -- Docutils Design Specificationあたり。
その他 Google 系というか GSoC がらみというか Google App Engine がらみでは

The SoC framework, and Melange web applications built upon it, are implemented in Python (since that is the only programming language currently supported by Google App Engine). This style guide is a list of dos and don'ts for Python contributions to the Melange project.
PythonStyleGuide - soc - Style guide for Python code contributed to Melange - Project Hosting on Google Code

この議論は賞味期限が切れたので、アーカイブ化されています。 新たにコメントを付けることはできません。
typodupeerror

犯人は巨人ファンでA型で眼鏡をかけている -- あるハッカー

読み込み中...