Skip to content

Commit a69a422

Browse files
committed
comment with socket room
Change-Id: I262de69f84163440ae90fec01ca31ebdb3d2f09c
1 parent 72509ef commit a69a422

File tree

11 files changed

+2010
-2
lines changed

11 files changed

+2010
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,12 @@ python的强大之处有很大的一方面在于它有各种各样非常强大
289289

290290
## [inspect](content/inspect.md)
291291

292+
## [ply](content/ply.md)
293+
292294
## [marshmallow](content/marshmallow.md)
293295

296+
## [abc](content/abc.md)
297+
294298
## [tools](content/tools.md)
295299

296300
## [Other_thing](content/other_thing.md)

code/abc_demo.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# coding=utf-8
2+
import abc
3+
4+
5+
class A(object):
6+
__metaclass__ = abc.ABCMeta
7+
8+
9+
class B(object):
10+
11+
__metaclass__ = abc.ABCMeta
12+
13+
@abc.abstractmethod
14+
def parse(self):
15+
return B
16+
17+
@abc.abstractproperty
18+
def name(self):
19+
return "B"
20+
21+
22+
class BB(B):
23+
def parse(self):
24+
return super(BB, self).parse()
25+
26+
@property
27+
def name(self):
28+
return super(BB, self).name
29+
30+
31+
A.register(tuple)
32+
33+
34+
if __name__ == '__main__':
35+
a = A()
36+
# b = B()
37+
# print(b.parse())
38+
bb = BB()
39+
print(bb.parse())
40+
print(bb.name)
41+
42+
print issubclass(tuple, A)
43+
print isinstance((), A)

0 commit comments

Comments
 (0)