Skip to content

Commit bb34f27

Browse files
authored
Merge pull request #45 from zr67800/patch-1
Escape underscores to make it displayed correctly
2 parents 98ee54f + b167f13 commit bb34f27

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/underscore.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ for _, val in list_of_tuples: # [(1,2),(3,4),(5,6)]
1919
print(val) # output - 3
2020
```
2121

22-
### \_single_leading_underscore
22+
### \_single\_leading\_underscore
2323

2424
This convention is used for declaring private variables, functions, methods and classes. Anything with this convention are ignored in `from module import *`.
2525

26-
### single_trailing_underscore_
26+
### single\_trailing\_underscore\_
2727

2828
This convention should be used for avoiding conflict with Python keywords or built-ins.
2929

@@ -32,13 +32,13 @@ class_ = dict(n=50, boys=25, girls=25)
3232
# avoiding clash with the class keyword
3333
```
3434

35-
### \__double_leading_underscore
35+
### \_\_double\_leading\_underscore
3636

3737
Double underscore will mangle the attribute names of a class to avoid conflicts of attribute names between classes. Python will automatically add "\_ClassName" to the front of the attribute name which has a double underscore in front of it.
3838

3939
[Read more](https://docs.python.org/3/tutorial/classes.html#private-variables)
4040

41-
### \__double_leading_and_trailing_underscore\_\_
41+
### \_\_double_leading_and_trailing_underscore\_\_
4242

4343
This convention is used for special variables or ( magic )methods such as`__init__`, `__len__`. These methods provides special syntactic features.
4444

0 commit comments

Comments
 (0)