Skip to content

Commit

Permalink
Import of GitHub PR #1644: merge_files should overwrite the existing …
Browse files Browse the repository at this point in the history
…annotations

#1644
Merge e3dadfc into 46acb94

PiperOrigin-RevId: 643926820
  • Loading branch information
YingboFu authored and copybara-github committed Jun 17, 2024
1 parent 3956254 commit 177c0cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pytype/tools/merge_pyi/merge_pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def _merge_csts(*, py_tree, pyi_tree):
vis.store_stub_in_context(context, pyi_tree)
return vis(
context,
overwrite_existing_annotations=True,
strict_posargs_matching=False,
strict_annotation_matching=True,
).transform_module(py_tree)
Expand Down
2 changes: 1 addition & 1 deletion pytype/tools/merge_pyi/test_data/defaults.pep484.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def f6(x:e6=int) -> r6:
pass

# static analysis would give error here
def f7(x : int=int):
def f7(x:e7=int) -> r7:
pass

def f8(x:e8={1:2}) -> r8:
Expand Down
4 changes: 2 additions & 2 deletions pytype/tools/merge_pyi/test_data/partial.pep484.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def f1(a, b : int):
def f1(a: e1, b: e2) -> r1:
pass

def f2(a, b) -> int:
def f2(a: e1, b: e2) -> r2:
pass

def f3(a) -> r3:
Expand Down

0 comments on commit 177c0cb

Please sign in to comment.