10000 [conflict] Fix #1855: Multiassign from Union by elazarg · Pull Request #2154 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

[conflict] Fix #1855: Multiassign from Union #2154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
7e043d0
handle union, add test
elazarg Sep 18, 2016
9a50d73
kill blank
elazarg Sep 18, 2016
5c4d86e
more tests
elazarg Sep 18, 2016
60cfbbb
handle binding
elazarg Sep 19, 2016
5e9e0f2
try to minimize visual difference
elazarg Sep 19, 2016
71f8475
(cont.)
elazarg Sep 19, 2016
42b6e73
add tests
elazarg Sep 21, 2016
0560bd8
no binder yet
elazarg Sep 23, 2016
7683ee2
Sync typeshed
Sep 23, 2016
8f0316f
Docs: Replace "if False" trick with "if TYPE_CHECKING". (#2181)
davidfstr Sep 25, 2016
fde83d5
Add column number support (#2163)
bavardage Sep 25, 2016
2fbf387
Fix #2070 - bytes formatting incorrect in python 3 (#2168)
buckbaskin Sep 26, 2016
da3a516
Support rebinding on multiassignment from union
elazarg Sep 27, 2016
ab60317
Merge remote-tracking branch 'upstream/master' into multiassign_union
elazarg Sep 27, 2016
6bb5519
more tests
elazarg Sep 27, 2016
0d2c594
Bare `Tuple` should mean `Tuple[Any, ...]`. (#2185)
gvanrossum Sep 27, 2016
2c73db5
Add --recursive and --ignore-errors flags to stubgen (#2183)
rtpg Sep 27, 2016
d2c6e8b
Fix lint
Sep 27, 2016
5c03ac9
Make runtests.py output less verbose
Sep 27, 2016
c3e1b35
Small module name translation fix for fast parser (#2187)
ddfisher Sep 27, 2016
87f7d90
Fix overzealous new submodule check (#2189)
Michael0x2a Sep 28, 2016
c752b42
Sync typeshed
Sep 28, 2016
5f0d02c
Implement PEP 526 Variable Annotations Syntax (#2131)
ilevkivskyi Sep 28, 2016
bec9454
Fix a fixup bug for nested class references.
Sep 28, 2016
a9fac0b
Add gitter chat room
gvanrossum Sep 29, 2016
ea23ac0
Rename --suppress-error-context to --hide-error-context (#2192)
gvanrossum Sep 29, 2016
4a34623
Add gitter badge for the new chat room (#2202)
gvanrossum Sep 30, 2016
2db6a11
Don't crash in fast parser on complex numbers in Python 2 mode
Oct 1, 2016
6151d20
Add more precise types to fastparse{,2}.py (#2204)
elazarg Oct 1, 2016
4a457fc
Tighter types for binder, checker and checkexpr (#2205)
elazarg Oct 1, 2016
c8a9b52
Tighten types for semanal (#2207)
elazarg Oct 2, 2016
af0b24a
Tighten types for parse.py and some more (#2208)
elazarg Oct 2, 2016
d5c5c02
Make Expression and Statement separable (#2209)
elazarg Oct 3, 2016
640921b
Make Expression, Statement true subclasses of Node. See #1783.
Oct 3, 2016
20aea69
Add mypy.ini. Fix strict none errors in the test subpackage. (#2200)
gvanrossum Oct 3, 2016
a3b6546
Sync typeshed
Oct 3, 2016
91a2275
Document support for Python 3.6 features.
Oct 3, 2016
bc4a390
Document --show-column-numbers and --scripts-are-modules
Oct 3, 2016
2e6cb95
Shorten "inherently stale" log message if all nodes in scc are stale
Oct 3, 2016
d6a7069
Fix lint error
Oct 3, 2016
eb16d1d
Remove weird implementation of --show_traceback and --pdb. (#2216)
gvanrossum Oct 4, 2016
dd71ddc
RIP weak mode. (#2217)
gvanrossum Oct 4, 2016
38651c4
handle union, add test
elazarg Sep 18, 2016
9000099
kill blank
elazarg Sep 18, 2016
f20f3d6
more tests
elazarg Sep 18, 2016
61be4e9
handle binding
elazarg Sep 19, 2016
9830cb4
try to minimize visual difference
elazarg Sep 19, 2016
59dc8b7
(cont.)
elazarg Sep 19, 2016
7f304e4
add tests
elazarg Sep 21, 2016
ff1ca80
no binder yet
elazarg Sep 23, 2016
168087e
Support rebinding on multiassignment from union
elazarg Sep 27, 2016
3f198cf
more tests
elazarg Sep 27, 2016
4fa059f
Rebase
elazarg Oct 5, 2016
ab35a4c
Merge
elazarg Oct 5, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename --suppress-error-context to --hide-error-context (#2192)
  • Loading branch information
gvanrossum authored Sep 29, 2016
commit ea23ac02798d48a865259c8b0ba75329c1ac2d63
2 changes: 1 addition & 1 deletion docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ flag (or its long form ``--help``)::
[--disallow-untyped-defs] [--check-untyped-defs]
[--disallow-subclassing-any] [--warn-incomplete-stub]
[--warn-redundant-casts] [--warn-unused-ignores]
[--suppress-error-context] [--fast-parser] [-i]
[--hide-error-context] [--fast-parser] [-i]
[--cache-dir DIR] [--strict-optional]
[--strict-optional-whitelist [GLOB [GLOB ...]]] [--pdb]
[--show-traceback] [--stats] [--inferstats]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/config_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The following global flags may only be set in the global section
- ``cache_dir`` (string, default ``.mypy_cache``) stores module cache
info in the given folder in incremental mode.

- ``suppress_error_context`` (Boolean, default False) suppresses
- ``hide_error_context`` (Boolean, default False) hides
context notes before errors.


Expand Down
2 changes: 1 addition & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def __init__(self, data_dir: str,
version_id: str) -> None:
self.start_time = time.time()
self.data_dir = data_dir
self.errors = Errors(options.suppress_error_context, options.show_column_numbers)
self.errors = Errors(options.hide_error_context, options.show_column_numbers)
self.errors.set_ignore_prefix(ignore_prefix)
self.lib_path = tuple(lib_path)
self.source_set = source_set
Expand Down
10 changes: 5 additions & 5 deletions mypy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ class Errors:
only_once_messages = None # type: Set[str]

# Set to True to suppress "In function "foo":" messages.
suppress_error_context = False # type: bool
hide_error_context = False # type: bool

# Set to True to show column numbers in error messages
show_column_numbers = False # type: bool

def __init__(self, suppress_error_context: bool = False,
def __init__(self, hide_error_context: bool = False,
show_column_numbers: bool = False) -> None:
self.error_info = []
self.import_ctx = []
Expand All @@ -108,11 +108,11 @@ def __init__(self, suppress_error_context: bool = False,
self.ignored_lines = OrderedDict()
self.used_ignored_lines = defaultdict(set)
self.only_once_messages = set()
self.suppress_error_context = suppress_error_context
self.hide_error_context = hide_error_context
self.show_column_numbers = show_column_numbers

def copy(self) -> 'Errors':
new = Errors(self.suppress_error_context, self.show_column_numbers)
new = Errors(self.hide_error_context, self.show_column_numbers)
new.file = self.file
new.import_ctx = self.import_ctx[:]
new.type_name = self.type_name[:]
Expand Down Expand Up @@ -309,7 +309,7 @@ def render_messages(self, errors: List[ErrorInfo]) -> List[Tuple[str, int, int,
file = self.simplify_path(e.file)

# Report context within a source file.
if self.suppress_error_context:
if self.hide_error_context:
pass
elif (e.function_or_member != prev_function_or_member or
e.type != prev_type):
Expand Down
6 changes: 3 additions & 3 deletions mypy/main.py
Original file line number Diff line number Diff line c 67E6 hange
Expand Up @@ -166,9 +166,9 @@ def process_options(args: List[str],
help="warn about casting an expression to its inferred type")
parser.add_argument('--warn-unused-ignores', action='store_true',
help="warn about unneeded '# type: ignore' comments")
parser.add_argument('--suppress-error-context', action='store_true',
dest='suppress_error_context',
help="Suppress context notes before errors")
parser.add_argument('--hide-error-context', action='store_true',
dest='hide_error_context',
help="Hide context notes before errors")
parser.add_argument('--fast-parser', action='store_true',
help="enable experimental fast parser")
parser.add_argument('-i', '--incremental', action='store_true',
Expand Down
2 changes: 1 addition & 1 deletion mypy/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __init__(self) -> None:
self.incremental = False
self.cache_dir = defaults.CACHE_DIR
self.debug_cache = False
self.suppress_error_context = False # Suppress "note: In function "foo":" messages.
self.hide_error_context = False # Hide "note: In function "foo":" messages.
self.shadow_file = None # type: Optional[Tuple[str, str]]
self.show_column_numbers = False # type: bool

Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/check-async-await.test
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ main: note: In function "f":
-- ------------------------------------------

[case testFullCoroutineMatrix]
# flags: --fast-parser --suppress-error-context
# flags: --fast-parser --hide-error-context
from typing import Any, AsyncIterator, Awaitable, Generator, Iterator
from types import coroutine

Expand Down
6 changes: 3 additions & 3 deletions test-data/unit/cmdline.test
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def f():
# cmd: mypy x.py y.py z.py
[file mypy.ini]
[[mypy]
suppress_error_context = True
hide_error_context = True
disallow_untyped_defs = True
[[mypy-y*]
disallow_untyped_defs = False
Expand Down Expand Up @@ -161,7 +161,7 @@ x.py:1: error: Function is missing a type annotation
# cmd: mypy xx.py xy.py yx.py yy.py
[file mypy.ini]
[[mypy]
suppress_error_context = True
hide_error_context = True
[[mypy-*x*.py]
disallow_untyped_defs = True
[[mypy-*y*.py]
Expand Down Expand Up @@ -190,7 +190,7 @@ xx.py:1: error: Function is missing a type annotation
# cmd: mypy x.py y.py z.py
[file mypy.ini]
[[mypy]
suppress_error_context = True
hide_error_context = True
[[mypy-x*py,z*py]
disallow_untyped_defs = True
[file x.py]
Expand Down
0