File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ def visit_class_def(self, node: ClassDef) -> None:
92
92
def strip_type_info (self , info : TypeInfo ) -> None :
93
93
info .type_vars = []
94
94
info .bases = []
95
+ info .is_abstract = False
95
96
info .abstract_attributes = []
96
97
info .mro = []
97
98
info .add_type_vars ()
Original file line number Diff line number Diff line change @@ -4249,6 +4249,54 @@ class g(Generic[T]):
4249
4249
==
4250
4250
a.py:2: error: Incompatible types in assignment (expression has type "g[int]", variable has type "int")
4251
4251
4252
+ [case testMakeClassNoLongerAbstract1]
4253
+ [file z.py]
4254
+ from abc import abstractmethod, ABCMeta
4255
+ class I(metaclass=ABCMeta):
4256
+ @abstractmethod
4257
+ def f(self) -> None: pass
4258
+ [file b.py]
4259
+ from z import I
4260
+ class Foo(I):
4261
+ pass
4262
+ def x() -> Foo: return None
4263
+ [file z.py.2]
4264
+ from abc import abstractmethod, ABCMeta
4265
+ class I(metaclass=ABCMeta):
4266
+ pass
4267
+ [file b.py.2]
4268
+ from z import I
4269
+ class Foo(I):
4270
+ pass
4271
+ def x() -> Foo: return Foo()
4272
+ [out]
4273
+ ==
4274
+
4275
+ [case testMakeClassNoLongerAbstract2]
4276
+ -- this version never failed, but it is just a file-renaming
4277
+ -- away from the above test that did
4278
+ [file a.py]
4279
+ from abc import abstractmethod, ABCMeta
4280
+ class I(metaclass=ABCMeta):
4281
+ @abstractmethod
4282
+ def f(self) -> None: pass
4283
+ [file b.py]
4284
+ from a import I
4285
+ class Foo(I):
4286
+ pass
4287
+ def x() -> Foo: return None
4288
+ [file a.py.2]
4289
+ from abc import abstractmethod, ABCMeta
4290
+ class I(metaclass=ABCMeta):
4291
+ pass
4292
+ [file b.py.2]
4293
+ from a import I
4294
+ class Foo(I):
4295
+ pass
4296
+ def x() -> Foo: return Foo()
4297
+ [out]
4298
+ ==
4299
+
4252
4300
[case testRefreshClassBasedEnum]
4253
4301
import aa
4254
4302
[file aa.py]
You can’t perform that action at this time.
0 commit comments