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:
@@ -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"
|
||||
|
Reference in New Issue
Block a user