The method of object-oriented bis

Object-oriented double the number of offline:
the init
STR
the repr

new new, singleton / rest framework sequence of
call, flask request source inlet, django request inlet (WSGIHandler .__ call__).
getattr
setattr
delattr, the Local Object Flask

setItem
getItem
delItem,
class Foo (Object):

def __getitem__(self, item):
return 1

DEF __setitem __ (Self, Key, value):
Pass

DEF __delitem __ (Self, Key):
Pass

obj = Foo ()
obj [ 'K1']
obj [ 'K1'] = 123
del obj [ 'K1']

dict, API package when the data is returned: BaseResponse
MRO, the order of succession
slots, Local Object

Guess you like

Origin www.cnblogs.com/duhong0520/p/11653486.html