docs: update project and q30 READMEs
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
### 困难部分第 30 题
|
||||
此题考查继承与多态,我只需要按题目去定义即可。为了方便在列表中创建实例,加了`__init__`方法。Python 定义抽象类需要来自模块 abc 的装饰器 @abstractmethod,能够让 Pylance 不发出协变不兼容警告,此处为了简便没有使用
|
||||
|
||||
[回到主项目 README](../README.md)
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class Shape:
|
||||
def area(self):
|
||||
return
|
||||
return 0
|
||||
|
||||
class Circle(Shape):
|
||||
def __init__(self, r):
|
||||
|
||||
Reference in New Issue
Block a user