Skip to content

Commit eff6535

Browse files
committed
fix(UCL#263): Advertise underscore_separation for function names
1 parent eed1dce commit eff6535

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

ch05construction/02conventions.ipynb.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,14 @@ def add_to_reaction(a_name,
124124
# ## Naming Conventions
125125

126126
# %% [markdown]
127-
# [Camel case](https://en.wikipedia.org/wiki/Camel_case) is used in the following example, where class name is in UpperCamel, functions in lowerCamel and underscore_separation for variables names. This convention is used broadly in the python community.
127+
# [Camel case](https://en.wikipedia.org/wiki/Camel_case) is used for class names in the following example, while function and variable names follow snake_case (underscore_separation). This convention is widely used in the Python community, as stated in [PEP 8](https://pep8.org/).
128128

129129
# %%
130130
class ClassName:
131-
def methodName(variable_name):
131+
def method_name(variable_name):
132132
instance_variable = variable_name
133133

134134

135-
# %% [markdown]
136-
# This other example uses underscore_separation for all the names.
137-
138-
# %%
139-
class class_name:
140-
def method_name(a_variable):
141-
m_instance_variable = a_variable
142-
143-
144135
# %% [markdown]
145136
# ## Hungarian Notation
146137

0 commit comments

Comments
 (0)