Skip to content

Commit c52ab36

Browse files
authored
Update 81_Classes.md
Corretta un'errata informazione
1 parent 61cbbaa commit c52ab36

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

docs/Pyllole/81_Classes.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,9 @@ if __name__ == '__main__':
8484

8585
# Chiama un metodo statico
8686
print(Human.grunt()) # => "*grunt*"
87-
88-
# Non è possibile chiamare il metodo statico con l'istanza dell'oggetto
89-
# poiché i.grunt() metterà automaticamente "self" (l'oggetto i)
90-
# come argomento
91-
print(i.grunt()) # => TypeError: grunt() takes 0 positional arguments but 1 was given
87+
88+
# I metodi statici possono essere chiamati anche dalle istanze
89+
print(i.grunt()) # => "*grunt*"
9290

9391
# Aggiorna la property (age) di questa istanza
9492
i.age = 42

0 commit comments

Comments
 (0)