Clarify dunders.
This commit is contained in:
parent
6f8133c138
commit
070a23b4a0
29
pep-0008.txt
29
pep-0008.txt
|
@ -413,12 +413,31 @@ Imports
|
|||
public and internal interfaces still apply.
|
||||
|
||||
|
||||
Dunder Variables
|
||||
----------------
|
||||
Module level dunder names
|
||||
-------------------------
|
||||
|
||||
All relevant dunder variables (e.g. ``__all__``, ``__author__``,
|
||||
``__version__``, etc) should be placed after the module docstring and
|
||||
before any imports, separated by a blank line above and below.
|
||||
Module level "dunders" (i.e. names with two leading and two trailing
|
||||
underscores) such as ``__all__``, ``__author__``, ``__version__``,
|
||||
etc. should be placed after the module docstring but before any import
|
||||
statements *except* ``from __future__`` imports. Python mandates that
|
||||
future-imports must appear in the module before any other code except
|
||||
docstrings.
|
||||
|
||||
For example::
|
||||
|
||||
"""This is the example module.
|
||||
|
||||
This module does stuff.
|
||||
"""
|
||||
|
||||
from __future__ import barry_as_FLUFL
|
||||
|
||||
__all__ = ['a', 'b', 'c']
|
||||
__version__ = '0.1'
|
||||
__author__ = 'Cardinal Biggles'
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
String Quotes
|
||||
|
|
Loading…
Reference in New Issue