File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -815,9 +815,12 @@ x = 0
815
815
-- Test stability under import cycles
816
816
-- ----------------------------------
817
817
818
- -- The two tests are identical except one main has 'import x' and the other 'import y'.
818
+ -- The first two tests are identical except one main has 'import x' and the other 'import y'.
819
819
-- Previously (before build.order_ascc() was added) one of these would fail because the
820
820
-- imports were processed in the (reverse) order in which the files were encountered.
821
+ --
822
+ -- The third one isn't fixed by order_ascc(), but is fixed by the lightweight type
823
+ -- inference added to semanal.py (analyze_simple_literal_type()).
821
824
822
825
[case testImportCycleStability1]
823
826
import x
@@ -846,3 +849,17 @@ import x
846
849
class Sub(x.Base):
847
850
attr = x.Base.attr
848
851
[out]
852
+
853
+ [case testImportCycleStability3]
854
+ import y
855
+ [file x.py]
856
+ class Base:
857
+ pass
858
+ def foo() -> int:
859
+ import y
860
+ return y.Sub.attr
861
+ [file y.py]
862
+ import x
863
+ class Sub(x.Base):
864
+ attr = 0
865
+ [out]
You can’t perform that action at this time.
0 commit comments