Help! Mij lukt het niet

from _ast import *
from contextlib import contextmanager
def parse(source, filename=’’, mode=‘exec’, *,
@@ -551,6 +553,697 @@ def new(cls, *args, **kwargs):
type(…): ‘Ellipsis’,
}

Large float and imaginary literals get turned into infinities in the AST.

We unparse those infinities to INFSTR.

_INFSTR = “1e” + repr(sys.float_info.max_10_exp + 1)
class _Unparser(NodeVisitor):
“”“Methods in this class recursively traverse an AST and
output source code for the abstract syntax; original formatting
is disregarded.”""
def init(self):
self._source = []
self._buffer = []
self._indent = 0
def interleave(self, inter, f, seq):
“”“Call f on each item in seq, calling inter() in between.”""
seq = iter(seq)
try:
f(next(seq))299606
0
0
2021

© 2017 GitHub, Inc.
with by
GitHub Education