mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Fix tiny typos
This commit is contained in:
parent
967591e4c2
commit
4076d78e26
@ -482,7 +482,7 @@ except (TypeError, NameError):
|
|||||||
pass # Multiple exceptions can be handled together, if required.
|
pass # Multiple exceptions can be handled together, if required.
|
||||||
else: # Optional clause to the try/except block. Must follow all except blocks
|
else: # Optional clause to the try/except block. Must follow all except blocks
|
||||||
print("All good!") # Runs only if the code in try raises no exceptions
|
print("All good!") # Runs only if the code in try raises no exceptions
|
||||||
finally: # Execute under all circumstances
|
finally: # Execute under all circumstances
|
||||||
print("We can clean up resources here")
|
print("We can clean up resources here")
|
||||||
|
|
||||||
# Instead of try/finally to cleanup resources you can use a with statement
|
# Instead of try/finally to cleanup resources you can use a with statement
|
||||||
@ -735,7 +735,7 @@ class Human:
|
|||||||
return "*grunt*"
|
return "*grunt*"
|
||||||
|
|
||||||
# A property is just like a getter.
|
# A property is just like a getter.
|
||||||
# It turns the method age() into an read-only attribute of the same name.
|
# It turns the method age() into a read-only attribute of the same name.
|
||||||
# There's no need to write trivial getters and setters in Python, though.
|
# There's no need to write trivial getters and setters in Python, though.
|
||||||
@property
|
@property
|
||||||
def age(self):
|
def age(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user