Skip to content

Optimize mypy.fastparse (Python 3 only) #5722

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 15 commits into from
Oct 3, 2018
Prev Previous commit
Next Next commit
Update based on review
  • Loading branch information
JukkaL committed Oct 3, 2018
commit d4d928916351264c9f4e215ac5a5e18f5b501d34
8 changes: 1 addition & 7 deletions mypy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,4 @@ def console_entry() -> None:


if __name__ == '__main__':
import cProfile
import pstats

cProfile.run('main(None)', 'profstats')
p = pstats.Stats('profstats')
p.sort_stats('time').print_stats(40)
#main(None)
main(None)
2 changes: 0 additions & 2 deletions mypy/fastparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,13 @@ def translate_expr_list(self, l: Sequence[AST]) -> List[Expression]:
res = [] # type: List[Expression]
for e in l:
exp = self.visit(e)
# assert isinstance(exp, Expression)
res.append(exp)
return res

def translate_stmt_list(self, l: Sequence[AST]) -> List[Statement]:
res = [] # type: List[Statement]
for e in l:
stmt = self.visit(e)
# assert isinstance(stmt, Statement)
res.append(stmt)
return res

Expand Down