Update 'PYGUIDE.md'

This commit is contained in:
Guille 2020-06-09 11:49:50 -04:00
parent 43a0e86492
commit 508fefa3d0

View File

@ -94,3 +94,54 @@ always access your variable throught the method and avoid to access directly.
return self.object_attribute * 2
```
Attributes with known units should be explicit in method's names
```python
@property
def distance_m(self):
return self._distance
```
### Coments
#### code documentation
all public classes, properties and methods must have code comments
```python
class MyClass
"""
MyClass class perform models class operations
"""
def __init__(self):
@property
def object_attribute(self):
"""
My class object attribute
:return: int
"""
return self._object_attribute
def operation(self, first_param, second_param):
"""
multiplies object_attribute by two
:return: int
"""
return self.object_attribute * 2
```
#### To do's
Pending to implement operations should be indicated with ToDo comments to highlight the missing operation
```python
# ToDo: right now extracted at city level, in the future should be extracted also at building level if exist
```