Enable type annotations for python/autograph.
PiperOrigin-RevId: 317168016 Change-Id: I57341cc0347ab8eb008949e191da1415069203b7
This commit is contained in:
parent
51f3da9ca8
commit
8944a3eeb1
@ -22,6 +22,7 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import re
|
||||
import sys
|
||||
import textwrap
|
||||
import tokenize
|
||||
|
||||
@ -33,11 +34,18 @@ from tensorflow.python.autograph.pyct import errors
|
||||
from tensorflow.python.autograph.pyct import inspect_utils
|
||||
|
||||
|
||||
STANDARD_PREAMBLE = textwrap.dedent("""
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
PY2_PREAMBLE = textwrap.dedent("""
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
""")
|
||||
STANDARD_PREAMBLE_LEN = 2
|
||||
PY3_PREAMBLE = ''
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
STANDARD_PREAMBLE = PY3_PREAMBLE
|
||||
else:
|
||||
STANDARD_PREAMBLE = PY2_PREAMBLE
|
||||
|
||||
STANDARD_PREAMBLE_LEN = STANDARD_PREAMBLE.count('__future__')
|
||||
|
||||
|
||||
_LEADING_WHITESPACE = re.compile(r'\s*')
|
||||
|
Loading…
Reference in New Issue
Block a user