Skip to content

Commit 420d0c9

Browse files
author
Sagar Chalise
committed
exception names
1 parent 2aef4d3 commit 420d0c9

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/python/classes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ sidebar_label: Classes
1010
* Classes names should always be `PascalCase`. i.e. `MyClass`
1111
* Even if you are building datatypes based on inbuilt class use PascalCase. i.e. `MyDict(dict):`
1212
* Describe the class resposibility in name.
13+
* Custom Exceptions should always be named ending with `Error` i.e. `MyCustomError`

docs/python/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar_label: Functions
88

99
* Avoid inbuilt names.
1010
* `snake_case` or descriptive single word in **lowercase** should be used.
11-
* function names should explain the functionality.
11+
* function names should explain the functionality.
1212
* for bound methods `self` should be used for first argument.
1313
* for class methods `cls` should be used for first argument.
1414
* `decorators` should be named in function convention.

docs/python/variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ sidebar_label: Variables
1212
- `__{variable_name}` if you want something to be private.
1313
- `_{variable_name}` if you want something to be not publicly used or something that may change later.
1414
- `__{variable_name}` are not directly accesible while `_{variable_name}` are. They are just for convention.
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.
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.
1616
- `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.

0 commit comments

Comments
 (0)