8000 Fixed missing indentation and minor typos (#20) · pythonitalia/python-abc@61cbbaa · GitHub
[go: up one dir, main page]

Skip to content

Commit 61cbbaa

Browse files
authored
Fixed missing indentation and minor typos (#20)
* Fixed missing indentation * Fixed typo * Other typos
1 parent 4542d29 commit 61cbbaa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/Pyllole/81_Classes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class Human:
2020
# Assegna l'argomento all'attributo name dell'istanza
2121
self.name = name
2222

23-
# Inizializza una proprietà
24-
self._age = 0
23+
# Inizializza una proprietà
24+
self._age = 0
2525

26-
# Un metodo dell'istanza. Tutti i metodi prendo "self"
26+
# Un metodo dell'istanza. Tutti i metodi prendono "self"
2727
# come primo argomento
2828
def say(self, msg):
2929
print("{name}: {message}".format(name=self.name, message=msg))
@@ -45,7 +45,7 @@ class Human:
4545
return "*grunt*"
4646

4747
# Una property è come un metodo getter.
48-
# Trasforma il metodo age() in un attributo in sola lettura,
48+
# Trasforma il metodo age() in un attributo in sola lettura,
4949
# che ha lo stesso nome
5050
@property
5151
def age(self):
@@ -94,7 +94,7 @@ if __name__ == '__main__':
9494
i.age = 42
9595
# Leggi la property
9696
i.say(i.age) # => "Ian: 42"
97-
j.say(j.age) # => "Joel: 0"
97+
j.say(j.age) # => "Joel: 0"
9898
# Cancella la property
9999
del i.age
100100
i.age # => questo genererà un AttributeError

0 commit comments

Comments
 (0)
0