SG-IDDescriptionReference
SG_1

Python Coding

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

Naming convention:

Packages 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
Class- and exception-names
"""
Use the CapWords convention.

Examples:
"""
CellControl			# Class name
LocationNotFound	# Exception
Functions, methods and variables
""" 
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)
Constants
""" 
Use all upercase names

Example:
"""
MAX_COUNT = 100
Inheritance
"""
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



  • Keine Stichwörter