1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-01 04:20:39 +02:00

Changed way of creating classes

This commit is contained in:
Gnomino
2015-10-11 13:47:44 +02:00
parent aad7eb82dd
commit 097c839b7b
2 changed files with 4 additions and 4 deletions

View File

@@ -569,8 +569,8 @@ filter(lambda x: x > 5, [3, 4, 5, 6, 7]) # => [6, 7]
####################################################
# We subclass from object to get a class.
class Human(object):
# We use the "class" operator to get a class
class Human:
# A class attribute. It is shared by all instances of this class
species = "H. sapiens"