Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

SG-IDDescriptionReference
SG_1

Python Coding

Python coding has to follow PEP 8 guidelines from Python Software Foundation.

Naming convention:

Codeblock
languagepy
titlePackages and Modules
"""
Modules should have short, all-lowercase names. Underscores 
can be used in the module name if it improves readability. 
Python packages should also have short, all-lowercase names, 
although the use of underscores is discouraged. 

Example:
""" 
flecsimo			# Main package


Codeblock
languagepy
titleClass- and exception-names
collapsetrue
"""
Use the CapWords convention.

Examples:
"""
CellControl			# Class name
LocationNotFound	# Exception


Codeblock
languagepy
titleFunctions, methods and variables
collapsetrue
""" 
Use all-lowercase names, with words separated by 
underscores as necessary to improve readability.

Example:
"""
send_message(topic, payload, num_retries)
con = Connection(database)
print(con.id)


Codeblock
languagepy
titleConstants
collapsetrue
""" 
Use all upercase names

Example:
"""
MAX_COUNT = 100


Codeblock
languagepy
titleInheritance
collapsetrue
"""
Public attributes should not have leading undescores.

On collision with reserved keywords, single trailing 
underscore should be appended.

"Private" class member attributes, functions or methods 
(well let's say: not meant for public use) should be
marked with one leading underscore.

Protected attributes should be marked with two leading
underscores.

Examples:
"""
message        	# public
message_		# Avoid keyword collision
_message		# mark for scope internal use 
__message		# mark attribute protected


PEP 8
SG_2

Docstrings

Using Docstrings improves readability and documentation of code. Docstring should be used following PEP 257

conventions from Python Software Foundation. Docstrings should be in google style

The following modification apply to this project:


PEP 257
Google Style



...