Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
unparse.Unparser Class Reference

List of all members.

Public Member Functions

def __init__
def fill
def write
def enter
def leave
def dispatch

Public Attributes

 f

Static Public Attributes

dictionary unop = {"Invert":"~", "Not": "not", "UAdd":"+", "USub":"-"}
dictionary binop
dictionary cmpops
dictionary boolops = {ast.And: 'and', ast.Or: 'or'}

Private Member Functions

def _Module
 Unparsing methods ###################### There should be one method per concrete grammar type # Constructors should be grouped by sum type.
def _Expr
def _Import
def _ImportFrom
def _Assign
def _AugAssign
def _Return
def _Pass
def _Break
def _Continue
def _Delete
def _Assert
def _Global
def _Nonlocal
def _Yield
def _Raise
def _TryExcept
def _TryFinally
def _ExceptHandler
def _ClassDef
def _FunctionDef
def _For
def _If
def _While
def _With
def _Bytes
def _Str
def _Name
def _Num
def _List
def _ListComp
def _GeneratorExp
def _SetComp
def _DictComp
def _comprehension
def _IfExp
def _Set
def _Dict
def _Tuple
def _UnaryOp
def _BinOp
def _Compare
def _BoolOp
def _Attribute
def _Call
def _Subscript
def _Ellipsis
def _Index
def _Slice
def _ExtSlice
def _arg
def _arguments
def _keyword
def _Lambda
def _alias

Private Attributes

 _indent

Detailed Description

Methods in this class recursively traverse an AST and
output source code for the abstract syntax; original formatting
is disregarded. 

Definition at line 26 of file unparse.py.


Constructor & Destructor Documentation

def unparse.Unparser.__init__ (   self,
  tree,
  file = sys.stdout 
)
Unparser(tree, file=sys.stdout) -> None.
 Print the source for tree to file.

Definition at line 31 of file unparse.py.

00031 
00032     def __init__(self, tree, file = sys.stdout):
00033         """Unparser(tree, file=sys.stdout) -> None.
00034          Print the source for tree to file."""
00035         self.f = file
00036         self._indent = 0
00037         self.dispatch(tree)
00038         print("", file=self.f)
00039         self.f.flush()

Here is the caller graph for this function:


Member Function Documentation

def unparse.Unparser._alias (   self,
  t 
) [private]

Definition at line 558 of file unparse.py.

00558 
00559     def _alias(self, t):
00560         self.write(t.name)
00561         if t.asname:
00562             self.write(" as "+t.asname)

def unparse.Unparser._arg (   self,
  t 
) [private]

Definition at line 496 of file unparse.py.

00496 
00497     def _arg(self, t):
00498         self.write(t.arg)
00499         if t.annotation:
00500             self.write(": ")
00501             self.dispatch(t.annotation)

def unparse.Unparser._arguments (   self,
  t 
) [private]

Definition at line 503 of file unparse.py.

00503 
00504     def _arguments(self, t):
00505         first = True
00506         # normal arguments
00507         defaults = [None] * (len(t.args) - len(t.defaults)) + t.defaults
00508         for a, d in zip(t.args, defaults):
00509             if first:first = False
00510             else: self.write(", ")
00511             self.dispatch(a)
00512             if d:
00513                 self.write("=")
00514                 self.dispatch(d)
00515 
00516         # varargs, or bare '*' if no varargs but keyword-only arguments present
00517         if t.vararg or t.kwonlyargs:
00518             if first:first = False
00519             else: self.write(", ")
00520             self.write("*")
00521             if t.vararg:
00522                 self.write(t.vararg)
00523                 if t.varargannotation:
00524                     self.write(": ")
00525                     self.dispatch(t.varargannotation)
00526 
00527         # keyword-only arguments
00528         if t.kwonlyargs:
00529             for a, d in zip(t.kwonlyargs, t.kw_defaults):
00530                 if first:first = False
00531                 else: self.write(", ")
00532                 self.dispatch(a),
00533                 if d:
00534                     self.write("=")
00535                     self.dispatch(d)
00536 
00537         # kwargs
00538         if t.kwarg:
00539             if first:first = False
00540             else: self.write(", ")
00541             self.write("**"+t.kwarg)
00542             if t.kwargannotation:
00543                 self.write(": ")
00544                 self.dispatch(t.kwargannotation)

def unparse.Unparser._Assert (   self,
  t 
) [private]

Definition at line 127 of file unparse.py.

00127 
00128     def _Assert(self, t):
00129         self.fill("assert ")
00130         self.dispatch(t.test)
00131         if t.msg:
00132             self.write(", ")
00133             self.dispatch(t.msg)

def unparse.Unparser._Assign (   self,
  t 
) [private]

Definition at line 95 of file unparse.py.

00095 
00096     def _Assign(self, t):
00097         self.fill()
00098         for target in t.targets:
00099             self.dispatch(target)
00100             self.write(" = ")
00101         self.dispatch(t.value)

def unparse.Unparser._Attribute (   self,
  t 
) [private]

Definition at line 435 of file unparse.py.

00435 
00436     def _Attribute(self,t):
00437         self.dispatch(t.value)
00438         # Special case: 3.__abs__() is a syntax error, so if t.value
00439         # is an integer literal then we need to either parenthesize
00440         # it or add an extra space to get 3 .__abs__().
00441         if isinstance(t.value, ast.Num) and isinstance(t.value.n, int):
00442             self.write(" ")
00443         self.write(".")
00444         self.write(t.attr)

def unparse.Unparser._AugAssign (   self,
  t 
) [private]

Definition at line 102 of file unparse.py.

00102 
00103     def _AugAssign(self, t):
00104         self.fill()
00105         self.dispatch(t.target)
00106         self.write(" "+self.binop[t.op.__class__.__name__]+"= ")
00107         self.dispatch(t.value)

def unparse.Unparser._BinOp (   self,
  t 
) [private]

Definition at line 411 of file unparse.py.

00411 
00412     def _BinOp(self, t):
00413         self.write("(")
00414         self.dispatch(t.left)
00415         self.write(" " + self.binop[t.op.__class__.__name__] + " ")
00416         self.dispatch(t.right)
00417         self.write(")")

def unparse.Unparser._BoolOp (   self,
  t 
) [private]

Definition at line 429 of file unparse.py.

00429 
00430     def _BoolOp(self, t):
00431         self.write("(")
00432         s = " %s " % self.boolops[t.op.__class__]
00433         interleave(lambda: self.write(s), self.dispatch, t.values)
00434         self.write(")")

def unparse.Unparser._Break (   self,
  t 
) [private]

Definition at line 117 of file unparse.py.

00117 
00118     def _Break(self, t):
00119         self.fill("break")

Here is the call graph for this function:

def unparse.Unparser._Bytes (   self,
  t 
) [private]

Definition at line 308 of file unparse.py.

00308 
00309     def _Bytes(self, t):
00310         self.write(repr(t.s))

def unparse.Unparser._Call (   self,
  t 
) [private]

Definition at line 445 of file unparse.py.

00445 
00446     def _Call(self, t):
00447         self.dispatch(t.func)
00448         self.write("(")
00449         comma = False
00450         for e in t.args:
00451             if comma: self.write(", ")
00452             else: comma = True
00453             self.dispatch(e)
00454         for e in t.keywords:
00455             if comma: self.write(", ")
00456             else: comma = True
00457             self.dispatch(e)
00458         if t.starargs:
00459             if comma: self.write(", ")
00460             else: comma = True
00461             self.write("*")
00462             self.dispatch(t.starargs)
00463         if t.kwargs:
00464             if comma: self.write(", ")
00465             else: comma = True
00466             self.write("**")
00467             self.dispatch(t.kwargs)
00468         self.write(")")

def unparse.Unparser._ClassDef (   self,
  t 
) [private]

Definition at line 202 of file unparse.py.

00202 
00203     def _ClassDef(self, t):
00204         self.write("\n")
00205         for deco in t.decorator_list:
00206             self.fill("@")
00207             self.dispatch(deco)
00208         self.fill("class "+t.name)
00209         self.write("(")
00210         comma = False
00211         for e in t.bases:
00212             if comma: self.write(", ")
00213             else: comma = True
00214             self.dispatch(e)
00215         for e in t.keywords:
00216             if comma: self.write(", ")
00217             else: comma = True
00218             self.dispatch(e)
00219         if t.starargs:
00220             if comma: self.write(", ")
00221             else: comma = True
00222             self.write("*")
00223             self.dispatch(t.starargs)
00224         if t.kwargs:
00225             if comma: self.write(", ")
00226             else: comma = True
00227             self.write("**")
00228             self.dispatch(t.kwargs)
00229         self.write(")")
00230 
00231         self.enter()
00232         self.dispatch(t.body)
00233         self.leave()

def unparse.Unparser._Compare (   self,
  t 
) [private]

Definition at line 420 of file unparse.py.

00420 
00421     def _Compare(self, t):
00422         self.write("(")
00423         self.dispatch(t.left)
00424         for o, e in zip(t.ops, t.comparators):
00425             self.write(" " + self.cmpops[o.__class__.__name__] + " ")
00426             self.dispatch(e)
00427         self.write(")")

def unparse.Unparser._comprehension (   self,
  t 
) [private]

Definition at line 356 of file unparse.py.

00356 
00357     def _comprehension(self, t):
00358         self.write(" for ")
00359         self.dispatch(t.target)
00360         self.write(" in ")
00361         self.dispatch(t.iter)
00362         for if_clause in t.ifs:
00363             self.write(" if ")
00364             self.dispatch(if_clause)

def unparse.Unparser._Continue (   self,
  t 
) [private]

Definition at line 120 of file unparse.py.

00120 
00121     def _Continue(self, t):
00122         self.fill("continue")

Here is the call graph for this function:

def unparse.Unparser._Delete (   self,
  t 
) [private]

Definition at line 123 of file unparse.py.

00123 
00124     def _Delete(self, t):
00125         self.fill("del ")
00126         interleave(lambda: self.write(", "), self.dispatch, t.targets)

def unparse.Unparser._Dict (   self,
  t 
) [private]

Definition at line 380 of file unparse.py.

00380 
00381     def _Dict(self, t):
00382         self.write("{")
00383         def write_pair(pair):
00384             (k, v) = pair
00385             self.dispatch(k)
00386             self.write(": ")
00387             self.dispatch(v)
00388         interleave(lambda: self.write(", "), write_pair, zip(t.keys, t.values))
00389         self.write("}")

def unparse.Unparser._DictComp (   self,
  t 
) [private]

Definition at line 347 of file unparse.py.

00347 
00348     def _DictComp(self, t):
00349         self.write("{")
00350         self.dispatch(t.key)
00351         self.write(": ")
00352         self.dispatch(t.value)
00353         for gen in t.generators:
00354             self.dispatch(gen)
00355         self.write("}")

def unparse.Unparser._Ellipsis (   self,
  t 
) [private]

Definition at line 476 of file unparse.py.

00476 
00477     def _Ellipsis(self, t):
00478         self.write("...")

def unparse.Unparser._ExceptHandler (   self,
  t 
) [private]

Definition at line 190 of file unparse.py.

00190 
00191     def _ExceptHandler(self, t):
00192         self.fill("except")
00193         if t.type:
00194             self.write(" ")
00195             self.dispatch(t.type)
00196         if t.name:
00197             self.write(" as ")
00198             self.write(t.name)
00199         self.enter()
00200         self.dispatch(t.body)
00201         self.leave()

def unparse.Unparser._Expr (   self,
  tree 
) [private]

Definition at line 79 of file unparse.py.

00079 
00080     def _Expr(self, tree):
00081         self.fill()
00082         self.dispatch(tree.value)

Here is the call graph for this function:

def unparse.Unparser._ExtSlice (   self,
  t 
) [private]

Definition at line 492 of file unparse.py.

00492 
00493     def _ExtSlice(self, t):
00494         interleave(lambda: self.write(', '), self.dispatch, t.dims)

def unparse.Unparser._For (   self,
  t 
) [private]

Definition at line 249 of file unparse.py.

00249 
00250     def _For(self, t):
00251         self.fill("for ")
00252         self.dispatch(t.target)
00253         self.write(" in ")
00254         self.dispatch(t.iter)
00255         self.enter()
00256         self.dispatch(t.body)
00257         self.leave()
00258         if t.orelse:
00259             self.fill("else")
00260             self.enter()
00261             self.dispatch(t.orelse)
00262             self.leave()

def unparse.Unparser._FunctionDef (   self,
  t 
) [private]

Definition at line 234 of file unparse.py.

00234 
00235     def _FunctionDef(self, t):
00236         self.write("\n")
00237         for deco in t.decorator_list:
00238             self.fill("@")
00239             self.dispatch(deco)
00240         self.fill("def "+t.name + "(")
00241         self.dispatch(t.args)
00242         self.write(")")
00243         if t.returns:
00244             self.write(" -> ")
00245             self.dispatch(t.returns)
00246         self.enter()
00247         self.dispatch(t.body)
00248         self.leave()

def unparse.Unparser._GeneratorExp (   self,
  t 
) [private]

Definition at line 333 of file unparse.py.

00333 
00334     def _GeneratorExp(self, t):
00335         self.write("(")
00336         self.dispatch(t.elt)
00337         for gen in t.generators:
00338             self.dispatch(gen)
00339         self.write(")")

def unparse.Unparser._Global (   self,
  t 
) [private]

Definition at line 134 of file unparse.py.

00134 
00135     def _Global(self, t):
00136         self.fill("global ")
00137         interleave(lambda: self.write(", "), self.write, t.names)

def unparse.Unparser._If (   self,
  t 
) [private]

Definition at line 263 of file unparse.py.

00263 
00264     def _If(self, t):
00265         self.fill("if ")
00266         self.dispatch(t.test)
00267         self.enter()
00268         self.dispatch(t.body)
00269         self.leave()
00270         # collapse nested ifs into equivalent elifs.
00271         while (t.orelse and len(t.orelse) == 1 and
00272                isinstance(t.orelse[0], ast.If)):
00273             t = t.orelse[0]
00274             self.fill("elif ")
00275             self.dispatch(t.test)
00276             self.enter()
00277             self.dispatch(t.body)
00278             self.leave()
00279         # final else
00280         if t.orelse:
00281             self.fill("else")
00282             self.enter()
00283             self.dispatch(t.orelse)
00284             self.leave()

Here is the call graph for this function:

def unparse.Unparser._IfExp (   self,
  t 
) [private]

Definition at line 365 of file unparse.py.

00365 
00366     def _IfExp(self, t):
00367         self.write("(")
00368         self.dispatch(t.body)
00369         self.write(" if ")
00370         self.dispatch(t.test)
00371         self.write(" else ")
00372         self.dispatch(t.orelse)
00373         self.write(")")

def unparse.Unparser._Import (   self,
  t 
) [private]

Definition at line 83 of file unparse.py.

00083 
00084     def _Import(self, t):
00085         self.fill("import ")
00086         interleave(lambda: self.write(", "), self.dispatch, t.names)

def unparse.Unparser._ImportFrom (   self,
  t 
) [private]

Definition at line 87 of file unparse.py.

00087 
00088     def _ImportFrom(self, t):
00089         self.fill("from ")
00090         self.write("." * t.level)
00091         if t.module:
00092             self.write(t.module)
00093         self.write(" import ")
00094         interleave(lambda: self.write(", "), self.dispatch, t.names)

def unparse.Unparser._Index (   self,
  t 
) [private]

Definition at line 479 of file unparse.py.

00479 
00480     def _Index(self, t):
00481         self.dispatch(t.value)

Here is the call graph for this function:

def unparse.Unparser._keyword (   self,
  t 
) [private]

Definition at line 545 of file unparse.py.

00545 
00546     def _keyword(self, t):
00547         self.write(t.arg)
00548         self.write("=")
00549         self.dispatch(t.value)

def unparse.Unparser._Lambda (   self,
  t 
) [private]

Definition at line 550 of file unparse.py.

00550 
00551     def _Lambda(self, t):
00552         self.write("(")
00553         self.write("lambda ")
00554         self.dispatch(t.args)
00555         self.write(": ")
00556         self.dispatch(t.body)
00557         self.write(")")

def unparse.Unparser._List (   self,
  t 
) [private]

Definition at line 321 of file unparse.py.

00321 
00322     def _List(self, t):
00323         self.write("[")
00324         interleave(lambda: self.write(", "), self.dispatch, t.elts)
00325         self.write("]")

def unparse.Unparser._ListComp (   self,
  t 
) [private]

Definition at line 326 of file unparse.py.

00326 
00327     def _ListComp(self, t):
00328         self.write("[")
00329         self.dispatch(t.elt)
00330         for gen in t.generators:
00331             self.dispatch(gen)
00332         self.write("]")

def unparse.Unparser._Module (   self,
  tree 
) [private]

Unparsing methods ###################### There should be one method per concrete grammar type # Constructors should be grouped by sum type.

Ideally, # this would follow the order in the grammar, but # currently doesn't. #

Definition at line 74 of file unparse.py.

00074 
00075     def _Module(self, tree):
00076         for stmt in tree.body:
00077             self.dispatch(stmt)

Here is the call graph for this function:

def unparse.Unparser._Name (   self,
  t 
) [private]

Definition at line 314 of file unparse.py.

00314 
00315     def _Name(self, t):
00316         self.write(t.id)

def unparse.Unparser._Nonlocal (   self,
  t 
) [private]

Definition at line 138 of file unparse.py.

00138 
00139     def _Nonlocal(self, t):
00140         self.fill("nonlocal ")
00141         interleave(lambda: self.write(", "), self.write, t.names)

def unparse.Unparser._Num (   self,
  t 
) [private]

Definition at line 317 of file unparse.py.

00317 
00318     def _Num(self, t):
00319         # Substitute overflowing decimal literal for AST infinities.
00320         self.write(repr(t.n).replace("inf", INFSTR))

def unparse.Unparser._Pass (   self,
  t 
) [private]

Definition at line 114 of file unparse.py.

00114 
00115     def _Pass(self, t):
00116         self.fill("pass")

Here is the call graph for this function:

def unparse.Unparser._Raise (   self,
  t 
) [private]

Definition at line 150 of file unparse.py.

00150 
00151     def _Raise(self, t):
00152         self.fill("raise")
00153         if not t.exc:
00154             assert not t.cause
00155             return
00156         self.write(" ")
00157         self.dispatch(t.exc)
00158         if t.cause:
00159             self.write(" from ")
00160             self.dispatch(t.cause)

def unparse.Unparser._Return (   self,
  t 
) [private]

Definition at line 108 of file unparse.py.

00108 
00109     def _Return(self, t):
00110         self.fill("return")
00111         if t.value:
00112             self.write(" ")
00113             self.dispatch(t.value)

def unparse.Unparser._Set (   self,
  t 
) [private]

Definition at line 374 of file unparse.py.

00374 
00375     def _Set(self, t):
00376         assert(t.elts) # should be at least one element
00377         self.write("{")
00378         interleave(lambda: self.write(", "), self.dispatch, t.elts)
00379         self.write("}")

def unparse.Unparser._SetComp (   self,
  t 
) [private]

Definition at line 340 of file unparse.py.

00340 
00341     def _SetComp(self, t):
00342         self.write("{")
00343         self.dispatch(t.elt)
00344         for gen in t.generators:
00345             self.dispatch(gen)
00346         self.write("}")

def unparse.Unparser._Slice (   self,
  t 
) [private]

Definition at line 482 of file unparse.py.

00482 
00483     def _Slice(self, t):
00484         if t.lower:
00485             self.dispatch(t.lower)
00486         self.write(":")
00487         if t.upper:
00488             self.dispatch(t.upper)
00489         if t.step:
00490             self.write(":")
00491             self.dispatch(t.step)

def unparse.Unparser._Str (   self,
  tree 
) [private]

Definition at line 311 of file unparse.py.

00311 
00312     def _Str(self, tree):
00313         self.write(repr(tree.s))

def unparse.Unparser._Subscript (   self,
  t 
) [private]

Definition at line 469 of file unparse.py.

00469 
00470     def _Subscript(self, t):
00471         self.dispatch(t.value)
00472         self.write("[")
00473         self.dispatch(t.slice)
00474         self.write("]")

def unparse.Unparser._TryExcept (   self,
  t 
) [private]

Definition at line 161 of file unparse.py.

00161 
00162     def _TryExcept(self, t):
00163         self.fill("try")
00164         self.enter()
00165         self.dispatch(t.body)
00166         self.leave()
00167 
00168         for ex in t.handlers:
00169             self.dispatch(ex)
00170         if t.orelse:
00171             self.fill("else")
00172             self.enter()
00173             self.dispatch(t.orelse)
00174             self.leave()

Here is the call graph for this function:

def unparse.Unparser._TryFinally (   self,
  t 
) [private]

Definition at line 175 of file unparse.py.

00175 
00176     def _TryFinally(self, t):
00177         if len(t.body) == 1 and isinstance(t.body[0], ast.TryExcept):
00178             # try-except-finally
00179             self.dispatch(t.body)
00180         else:
00181             self.fill("try")
00182             self.enter()
00183             self.dispatch(t.body)
00184             self.leave()
00185 
00186         self.fill("finally")
00187         self.enter()
00188         self.dispatch(t.finalbody)
00189         self.leave()

Here is the call graph for this function:

def unparse.Unparser._Tuple (   self,
  t 
) [private]

Definition at line 390 of file unparse.py.

00390 
00391     def _Tuple(self, t):
00392         self.write("(")
00393         if len(t.elts) == 1:
00394             (elt,) = t.elts
00395             self.dispatch(elt)
00396             self.write(",")
00397         else:
00398             interleave(lambda: self.write(", "), self.dispatch, t.elts)
00399         self.write(")")

def unparse.Unparser._UnaryOp (   self,
  t 
) [private]

Definition at line 401 of file unparse.py.

00401 
00402     def _UnaryOp(self, t):
00403         self.write("(")
00404         self.write(self.unop[t.op.__class__.__name__])
00405         self.write(" ")
00406         self.dispatch(t.operand)
00407         self.write(")")

def unparse.Unparser._While (   self,
  t 
) [private]

Definition at line 285 of file unparse.py.

00285 
00286     def _While(self, t):
00287         self.fill("while ")
00288         self.dispatch(t.test)
00289         self.enter()
00290         self.dispatch(t.body)
00291         self.leave()
00292         if t.orelse:
00293             self.fill("else")
00294             self.enter()
00295             self.dispatch(t.orelse)
00296             self.leave()

Here is the call graph for this function:

def unparse.Unparser._With (   self,
  t 
) [private]

Definition at line 297 of file unparse.py.

00297 
00298     def _With(self, t):
00299         self.fill("with ")
00300         self.dispatch(t.context_expr)
00301         if t.optional_vars:
00302             self.write(" as ")
00303             self.dispatch(t.optional_vars)
00304         self.enter()
00305         self.dispatch(t.body)
00306         self.leave()

def unparse.Unparser._Yield (   self,
  t 
) [private]

Definition at line 142 of file unparse.py.

00142 
00143     def _Yield(self, t):
00144         self.write("(")
00145         self.write("yield")
00146         if t.value:
00147             self.write(" ")
00148             self.dispatch(t.value)
00149         self.write(")")

def unparse.Unparser.dispatch (   self,
  tree 
)

Definition at line 57 of file unparse.py.

00057 
00058     def dispatch(self, tree):
00059         "Dispatcher function, dispatching tree type T to method _T."
00060         if isinstance(tree, list):
00061             for t in tree:
00062                 self.dispatch(t)
00063             return
00064         meth = getattr(self, "_"+tree.__class__.__name__)
00065         meth(tree)
00066 

Here is the call graph for this function:

def unparse.Unparser.enter (   self)

Definition at line 48 of file unparse.py.

00048 
00049     def enter(self):
00050         "Print ':', and increase the indentation."
00051         self.write(":")
00052         self._indent += 1

Here is the caller graph for this function:

def unparse.Unparser.fill (   self,
  text = "" 
)

Definition at line 40 of file unparse.py.

00040 
00041     def fill(self, text = ""):
00042         "Indent a piece of text, according to the current indentation level"
00043         self.f.write("\n"+"    "*self._indent + text)

Here is the caller graph for this function:

def unparse.Unparser.leave (   self)

Definition at line 53 of file unparse.py.

00053 
00054     def leave(self):
00055         "Decrease the indentation level."
00056         self._indent -= 1

Here is the caller graph for this function:

def unparse.Unparser.write (   self,
  text 
)

Definition at line 44 of file unparse.py.

00044 
00045     def write(self, text):
00046         "Append a piece of text to the current line."
00047         self.f.write(text)


Member Data Documentation

Definition at line 35 of file unparse.py.

Initial value:
{ "Add":"+", "Sub":"-", "Mult":"*", "Div":"/", "Mod":"%",
                    "LShift":"<<", "RShift":">>", "BitOr":"|", "BitXor":"^", "BitAnd":"&",
                    "FloorDiv":"//", "Pow": "**"}

Definition at line 408 of file unparse.py.

dictionary unparse.Unparser.boolops = {ast.And: 'and', ast.Or: 'or'} [static]

Definition at line 428 of file unparse.py.

Initial value:
{"Eq":"==", "NotEq":"!=", "Lt":"<", "LtE":"<=", "Gt":">", "GtE":">=",
                        "Is":"is", "IsNot":"is not", "In":"in", "NotIn":"not in"}

Definition at line 418 of file unparse.py.

Definition at line 34 of file unparse.py.

dictionary unparse.Unparser.unop = {"Invert":"~", "Not": "not", "UAdd":"+", "USub":"-"} [static]

Definition at line 400 of file unparse.py.


The documentation for this class was generated from the following file: