Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c6820ff

Browse files
Merge pull request #153 from bcaller/ast-cache
Cache of AST tree by module path
2 parents d7a94dd + 5f1498e commit c6820ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎pyt/core/ast_helper.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import ast
55
import os
66
import subprocess
7+
from functools import lru_cache
78

89

910
BLACK_LISTED_CALL_NAMES = ['self']
@@ -21,6 +22,7 @@ def _convert_to_3(path): # pragma: no cover
2122
exit(1)
2223

2324

25+
@lru_cache()
2426
def generate_ast(path):
2527
"""Generate an Abstract Syntax Tree using the ast module.
2628

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /