mirror of
https://github.com/Hizenberg469/Python-tutorial.git
synced 2026-04-19 23:12:24 +03:00
OOP finished
This commit is contained in:
18
OOP/SuperList.py
Normal file
18
OOP/SuperList.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#Implementing List:
|
||||
|
||||
class SuperList(list):
|
||||
def __len__(self):
|
||||
return 1000
|
||||
|
||||
|
||||
super_list1 = SuperList()
|
||||
|
||||
print(len(super_list1))
|
||||
|
||||
super_list1.append(5)
|
||||
|
||||
print(super_list1[0])
|
||||
|
||||
print(issubclass(SuperList, list))
|
||||
|
||||
print(issubclass(list, object))
|
||||
Reference in New Issue
Block a user