To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit d09d77ed authored by vermeul's avatar vermeul
Browse files

few additions

parent 7d062b42
......@@ -64,24 +64,18 @@
```
for event in events:
method_for[event.type]()
```
## use \_is\_ for booleans variables
## use `is`, `has`, `can` for booleans variables
* boolean variables are more self-documenting if they start with a **ìs_** prefix
* or if they contain **_is_** in between
* boolean variables are more self-documenting if they form a yes/no question
* `is_prime`
* `process_is_finished`
```
if process_is_finished:
...
```
* `process_has_started`
* `can_overwrite`
## prefix \_for\_internal\_use\_only methods and functions
## prefix `_for_internal_use_only` methods and functions
* Python has no easy way to prevent users from using an internal method
* so use an underscore: `_compute_this()`
* Tools like Jupyter or IPython will not list these internal methods when hitting the TAB for completion
\ No newline at end of file
* instead, the underscore-prefix is used as a convention: `_compute_this()`
* Tools like Jupyter or IPython will follow this convention by not listing these internal methods when hitting the TAB for completion
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment