summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-02-24 08:03:07 +0100
committerMartin Fischer <martin@push-f.com>2022-02-24 08:03:07 +0100
commitc0db4ed95908c0774815da22d4e810c2a5a7a266 (patch)
tree830aaa3f3f2406b98acb59b67b25e7d02bafb9b0
parent7c914668646504077caae217ca13332f6244f7d9 (diff)
prefix numbers to puzzles
-rwxr-xr-xcheck_checkers.py4
-rw-r--r--issues.toml9
-rw-r--r--puzzles/00_assign_wrong_type.py (renamed from puzzles/easy.py)0
-rw-r--r--puzzles/01_assign_reassign.py (renamed from puzzles/easy_reassign.py)0
-rw-r--r--puzzles/02_append.py (renamed from puzzles/infer_append.py)0
-rw-r--r--puzzles/03_assign_wrong_type_in_func.py2
-rw-r--r--puzzles/10_infer_return_type.py3
-rw-r--r--puzzles/20_enum_in_literal.py (renamed from puzzles/tricky_enum.py)0
-rw-r--r--puzzles/30_try_except_finally.py (renamed from puzzles/tricky_try_except.py)0
-rw-r--r--puzzles/40_recursive_types.py (renamed from puzzles/tricky_recursive.py)0
-rw-r--r--puzzles/50_typevar_constrained.py (renamed from puzzles/tricky_typevar_constrained.py)0
-rw-r--r--puzzles/infer_return_basic.py3
12 files changed, 13 insertions, 8 deletions
diff --git a/check_checkers.py b/check_checkers.py
index 1a883b3..90ccc43 100755
--- a/check_checkers.py
+++ b/check_checkers.py
@@ -219,7 +219,9 @@ def run(
if not expected:
checker_issues = issues.get(checker.__class__.__name__.lower(), {})
issue = checker_issues.get(
- os.path.splitext(os.path.basename(puzzle))[0]
+ os.path.splitext(os.path.basename(puzzle))[0].split(
+ '_', maxsplit=1
+ )[1]
)
if issue:
out.write('<br>(')
diff --git a/issues.toml b/issues.toml
index a840797..55104e2 100644
--- a/issues.toml
+++ b/issues.toml
@@ -1,7 +1,8 @@
[mypy]
-infer_return_basic = "mypy intentionally treats unannotated functions as returning Any"
-tricky_recursive = '<a href="https://github.com/python/mypy/issues/731">issue 731</a>'
-tricky_typevar_constrained = '<a href="https://github.com/python/mypy/issues/11880">issue 11880</a>'
+assign_wrong_type_in_func = "mypy does not check unannotated functions"
+infer_return_type = "mypy treats unannotated functions as returning Any"
+recursive_types = '<a href="https://github.com/python/mypy/issues/731">issue 731</a>'
+typevar_constrained = '<a href="https://github.com/python/mypy/issues/11880">issue 11880</a>'
[pytype]
-tricky_enum = '<a href="https://github.com/google/pytype/issues/790">issue 790</a>'
+enum_in_literal = '<a href="https://github.com/google/pytype/issues/790">issue 790</a>'
diff --git a/puzzles/easy.py b/puzzles/00_assign_wrong_type.py
index 6298e46..6298e46 100644
--- a/puzzles/easy.py
+++ b/puzzles/00_assign_wrong_type.py
diff --git a/puzzles/easy_reassign.py b/puzzles/01_assign_reassign.py
index aeed688..aeed688 100644
--- a/puzzles/easy_reassign.py
+++ b/puzzles/01_assign_reassign.py
diff --git a/puzzles/infer_append.py b/puzzles/02_append.py
index 3511512..3511512 100644
--- a/puzzles/infer_append.py
+++ b/puzzles/02_append.py
diff --git a/puzzles/03_assign_wrong_type_in_func.py b/puzzles/03_assign_wrong_type_in_func.py
new file mode 100644
index 0000000..6c87c71
--- /dev/null
+++ b/puzzles/03_assign_wrong_type_in_func.py
@@ -0,0 +1,2 @@
+def f():
+ x: int = 'Python' # error
diff --git a/puzzles/10_infer_return_type.py b/puzzles/10_infer_return_type.py
new file mode 100644
index 0000000..2776442
--- /dev/null
+++ b/puzzles/10_infer_return_type.py
@@ -0,0 +1,3 @@
+def f(): return "Python"
+
+f() + 3 # error
diff --git a/puzzles/tricky_enum.py b/puzzles/20_enum_in_literal.py
index a743168..a743168 100644
--- a/puzzles/tricky_enum.py
+++ b/puzzles/20_enum_in_literal.py
diff --git a/puzzles/tricky_try_except.py b/puzzles/30_try_except_finally.py
index d63ab10..d63ab10 100644
--- a/puzzles/tricky_try_except.py
+++ b/puzzles/30_try_except_finally.py
diff --git a/puzzles/tricky_recursive.py b/puzzles/40_recursive_types.py
index 5de796c..5de796c 100644
--- a/puzzles/tricky_recursive.py
+++ b/puzzles/40_recursive_types.py
diff --git a/puzzles/tricky_typevar_constrained.py b/puzzles/50_typevar_constrained.py
index 50ce10a..50ce10a 100644
--- a/puzzles/tricky_typevar_constrained.py
+++ b/puzzles/50_typevar_constrained.py
diff --git a/puzzles/infer_return_basic.py b/puzzles/infer_return_basic.py
deleted file mode 100644
index c2cbe7a..0000000
--- a/puzzles/infer_return_basic.py
+++ /dev/null
@@ -1,3 +0,0 @@
-def f(): return "Python"
-
-def g(): return f() + 3 # error