You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/python/variables.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,3 +14,6 @@ sidebar_label: Variables
14
14
-`__{variable_name}` are not directly accesible while `_{variable_name}` are. They are just for convention.
15
15
* Avoid builtin variable clash. Especially in `globals`. You can attach `_` as suffix to builtin names if you deem the name necessary for your variable.
16
16
-`all` or `id` is very tempting variable names but they are builtin methods in python. Go with `all_` or `id_` for these or better yet choose something else as a name.
17
+
* While it is tempting to use `i`, `k`, `v` and `f` especially in contexts and for loops. Please avoid them.
18
+
- use `key`, `value`, `index` instead.
19
+
- use descriptive contexts such as `with open(FILENAME) as open_file: pass` rather that `with open(FILENAME) as f:`
0 commit comments