8000 Update the fast parser to work with Python 2.7 by ddfisher · Pull Request #1418 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Update the fast parser to work with Python 2.7 #1418

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

Merged
merged 4 commits into from
Apr 22, 2016
Merged
Changes from 1 commit
Commits
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
Fix lint errors
  • Loading branch information
ddfisher committed Apr 22, 2016
commit 6f1d99bcb75a7fcb8fe3de828fb6f7d5c9efd3ce
7 changes: 4 additions & 3 deletions mypy/fastparse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import wraps
import sys

from typing import Tuple, Union, TypeVar, Callable, Sequence, Optional, Any, cast
from typing import Tuple, Union, TypeVar, Callable, Sequence, Optional, Any, cast, List
from mypy.nodes import (
MypyFile, Node, ImportBase, Import, ImportAll, ImportFrom, FuncDef, OverloadedFuncDef,
ClassDef, Decorator, Block, Var, OperatorAssignmentStmt,
Expand Down Expand Up @@ -617,8 +617,9 @@ def visit_Call(self, n: ast35.Call) -> Node:
def is_star2arg(k):
return k.arg is None

arg_types = self.visit_list([a.value if isinstance(a, ast35.Starred) else a for a in n.args] +
[k.value for k in n.keywords])
arg_types = self.visit_list(
[a.value if isinstance(a, ast35.Starred) else a for a in n.args] +
[k.value for k in n.keywords])
arg_kinds = ([ARG_STAR if isinstance(a, ast35.Starred) else ARG_POS for a in n.args] +
[ARG_STAR2 if is_star2arg(k) else ARG_NAMED for k in n.keywords])
return CallExpr(self.visit(n.func),
Expand Down
0