paul@0 | 1 | #!/usr/bin/env python |
paul@0 | 2 | |
paul@0 | 3 | """ |
paulb@109 | 4 | Simplified program nodes for easier type propagation and analysis. This module |
paulb@109 | 5 | contains nodes representing program instructions or operations, program |
paulb@109 | 6 | structure or organisation, and abstract program data. |
paul@0 | 7 | |
paul@0 | 8 | Copyright (C) 2006 Paul Boddie <paul@boddie.org.uk> |
paul@0 | 9 | |
paul@0 | 10 | This software is free software; you can redistribute it and/or |
paul@0 | 11 | modify it under the terms of the GNU General Public License as |
paul@0 | 12 | published by the Free Software Foundation; either version 2 of |
paul@0 | 13 | the License, or (at your option) any later version. |
paul@0 | 14 | |
paul@0 | 15 | This software is distributed in the hope that it will be useful, |
paul@0 | 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@0 | 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@0 | 18 | GNU General Public License for more details. |
paul@0 | 19 | |
paul@0 | 20 | You should have received a copy of the GNU General Public |
paul@0 | 21 | License along with this library; see the file LICENCE.txt |
paul@0 | 22 | If not, write to the Free Software Foundation, Inc., |
paul@0 | 23 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
paul@0 | 24 | """ |
paul@0 | 25 | |
paulb@19 | 26 | from compiler.visitor import ASTVisitor |
paulb@60 | 27 | import sys |
paulb@19 | 28 | |
paulb@83 | 29 | # Exceptions. |
paulb@83 | 30 | |
paulb@83 | 31 | class SimplifiedError(Exception): |
paulb@83 | 32 | |
paulb@83 | 33 | "An error in the annotation process." |
paulb@83 | 34 | |
paulb@83 | 35 | def __init__(self, exc, node, *args): |
paulb@83 | 36 | |
paulb@83 | 37 | """ |
paulb@83 | 38 | Initialise the error with an existing exception 'exc', the 'node' at |
paulb@83 | 39 | which this error occurs, along with additional optional arguments. |
paulb@83 | 40 | """ |
paulb@83 | 41 | |
paulb@83 | 42 | Exception.__init__(self, *args) |
paulb@83 | 43 | self.nodes = [node] |
paulb@83 | 44 | self.exc = exc |
paulb@83 | 45 | |
paulb@83 | 46 | def add(self, node): |
paulb@83 | 47 | |
paulb@83 | 48 | "Add the given 'node' to the path of nodes leading from the exception." |
paulb@83 | 49 | |
paulb@83 | 50 | self.nodes.append(node) |
paulb@83 | 51 | |
paulb@83 | 52 | def __str__(self): |
paulb@83 | 53 | |
paulb@83 | 54 | "Return a string showing the principal exception details." |
paulb@83 | 55 | |
paulb@83 | 56 | return "%s, %s" % (self.exc, self.nodes) |
paulb@83 | 57 | |
paulb@65 | 58 | # Unique name registration. |
paulb@65 | 59 | |
paulb@65 | 60 | class Naming: |
paulb@67 | 61 | |
paulb@67 | 62 | "Maintain records of unique names for each simple name." |
paulb@67 | 63 | |
paulb@78 | 64 | index_separator = "-" |
paulb@78 | 65 | |
paulb@65 | 66 | def __init__(self): |
paulb@65 | 67 | self.obj_to_name = {} |
paulb@65 | 68 | self.names = {} |
paulb@67 | 69 | |
paulb@65 | 70 | def get(self, obj): |
paulb@65 | 71 | return self.obj_to_name[obj] |
paulb@67 | 72 | |
paulb@65 | 73 | def set(self, obj, name): |
paulb@65 | 74 | if self.obj_to_name.has_key(obj): |
paulb@65 | 75 | return |
paulb@65 | 76 | if not self.names.has_key(name): |
paulb@65 | 77 | self.names[name] = 0 |
paulb@65 | 78 | n = self.names[name] + 1 |
paulb@65 | 79 | self.names[name] = n |
paulb@78 | 80 | self.obj_to_name[obj] = "%s%s%d" % (name, self.index_separator, n) |
paulb@65 | 81 | |
paulb@65 | 82 | naming = Naming() |
paulb@65 | 83 | |
paulb@65 | 84 | def name(obj, name): |
paulb@81 | 85 | |
paulb@81 | 86 | "Return a unique name for the given 'obj', indicating the base 'name'." |
paulb@81 | 87 | |
paulb@65 | 88 | naming.set(obj, name) |
paulb@65 | 89 | return naming.get(obj) |
paulb@65 | 90 | |
paulb@24 | 91 | # Elementary visitor support. |
paulb@24 | 92 | |
paulb@24 | 93 | class Visitor(ASTVisitor): |
paulb@24 | 94 | |
paulb@24 | 95 | "A visitor base class." |
paulb@24 | 96 | |
paulb@24 | 97 | def __init__(self): |
paulb@24 | 98 | ASTVisitor.__init__(self) |
paulb@24 | 99 | |
paulb@24 | 100 | def default(self, node, *args): |
paulb@24 | 101 | raise ValueError, node.__class__ |
paulb@24 | 102 | |
paulb@24 | 103 | def dispatch(self, node, *args): |
paulb@24 | 104 | return ASTVisitor.dispatch(self, node, *args) |
paulb@24 | 105 | |
paulb@24 | 106 | def dispatches(self, nodes, *args): |
paulb@24 | 107 | results = [] |
paulb@24 | 108 | for node in nodes: |
paulb@24 | 109 | results.append(self.dispatch(node, *args)) |
paulb@24 | 110 | return results |
paulb@24 | 111 | |
paulb@99 | 112 | def dispatch_dict(self, d, *args): |
paulb@99 | 113 | results = {} |
paulb@99 | 114 | for name, node in d.items(): |
paulb@99 | 115 | results[name] = self.dispatch(node, *args) |
paulb@99 | 116 | return results |
paulb@99 | 117 | |
paulb@24 | 118 | # Simplified program nodes. |
paulb@24 | 119 | |
paul@0 | 120 | class Node: |
paul@0 | 121 | |
paul@0 | 122 | """ |
paul@0 | 123 | A result node with common attributes: |
paul@0 | 124 | |
paul@0 | 125 | original The original node from which this node was created. |
paulb@81 | 126 | defining Whether the node defines something in the original program. |
paulb@16 | 127 | name Any name involved (variable or attribute). |
paulb@17 | 128 | index Any index involved (temporary variable name). |
paulb@17 | 129 | value Any constant value. |
paulb@17 | 130 | ref Any reference to (for example) subprograms. |
paulb@47 | 131 | nstype Any indication of the namespace type involved in a name access. |
paulb@17 | 132 | |
paulb@17 | 133 | Expression-related attributes: |
paulb@17 | 134 | |
paul@0 | 135 | expr Any contributing expression. |
paulb@16 | 136 | lvalue Any target expression. |
paulb@16 | 137 | test Any test expression in a conditional instruction. |
paulb@16 | 138 | |
paulb@16 | 139 | Invocation and subprogram attributes: |
paulb@16 | 140 | |
paulb@16 | 141 | args Any collection of argument nodes. |
paulb@16 | 142 | params Any collection of parameter nodes and defaults. |
paulb@16 | 143 | |
paulb@16 | 144 | Statement-grouping attributes: |
paulb@16 | 145 | |
paulb@16 | 146 | body Any conditional code depending on the success of a test. |
paulb@16 | 147 | else_ Any conditional code depending on the failure of a test. |
paulb@35 | 148 | handler Any exception handler code. |
paulb@16 | 149 | finally_ Any code which will be executed regardless. |
paulb@16 | 150 | code Any unconditional code. |
paulb@32 | 151 | choices Any choices which may be included in the final program. |
paul@0 | 152 | """ |
paul@0 | 153 | |
paulb@79 | 154 | def __init__(self, original=None, defining=0, **kw): |
paulb@47 | 155 | |
paulb@47 | 156 | """ |
paulb@79 | 157 | Initialise a program node with a link to an optional 'original' AST |
paulb@79 | 158 | node. An optional 'defining' parameter (if set to a true value), sets |
paulb@79 | 159 | this node as the defining node in the original. |
paulb@47 | 160 | """ |
paulb@47 | 161 | |
paul@0 | 162 | self.original = original |
paulb@79 | 163 | self.defining = defining |
paulb@79 | 164 | |
paulb@79 | 165 | if self.original is not None and defining: |
paulb@8 | 166 | self.original._node = self |
paul@0 | 167 | for name, value in kw.items(): |
paul@0 | 168 | setattr(self, name, value) |
paul@0 | 169 | |
paul@0 | 170 | def __repr__(self): |
paulb@81 | 171 | |
paulb@81 | 172 | "Return a readable representation." |
paulb@81 | 173 | |
paulb@65 | 174 | if hasattr(self, "full_name"): |
paulb@79 | 175 | s = "%s '%s'" % (self.__class__.__name__, self.full_name()) |
paulb@65 | 176 | elif hasattr(self, "name"): |
paulb@69 | 177 | s = "%s '%s'" % (self.__class__.__name__, self.name) |
paulb@65 | 178 | elif hasattr(self, "index"): |
paulb@69 | 179 | s = "%s (%s)" % (self.__class__.__name__, self.index) |
paul@0 | 180 | elif hasattr(self, "value"): |
paulb@69 | 181 | s = "%s %s" % (self.__class__.__name__, repr(self.value)) |
paul@0 | 182 | elif hasattr(self, "ref"): |
paulb@69 | 183 | s = "%s '%s'" % (self.__class__.__name__, name(self.ref, self.ref.name)) |
paul@0 | 184 | else: |
paulb@69 | 185 | s = "%s" % (self.__class__.__name__,) |
paulb@69 | 186 | |
paulb@69 | 187 | # Annotations. |
paulb@69 | 188 | |
paulb@69 | 189 | if hasattr(self, "types"): |
paulb@69 | 190 | return "%s -> %s" % (s, self.types) |
paulb@69 | 191 | else: |
paulb@69 | 192 | return s |
paul@0 | 193 | |
paulb@60 | 194 | def _pprint(self, indent, continuation, s, stream=None): |
paulb@81 | 195 | |
paulb@81 | 196 | """ |
paulb@81 | 197 | Print, at the given 'indent' level, with the given 'continuation' text, |
paulb@81 | 198 | the string 's', either to the given, optional 'stream' or to standard |
paulb@81 | 199 | output, this node's "pretty" representation. |
paulb@81 | 200 | """ |
paulb@81 | 201 | |
paulb@60 | 202 | stream = stream or sys.stdout |
paul@0 | 203 | if continuation: |
paulb@60 | 204 | print >>stream, (" " * max(0, indent - len(continuation))) + continuation + s |
paul@0 | 205 | else: |
paulb@60 | 206 | print >>stream, (" " * indent) + s |
paul@0 | 207 | |
paulb@60 | 208 | def pprint(self, indent=0, continuation=None, stream=None): |
paulb@81 | 209 | |
paulb@81 | 210 | """ |
paulb@81 | 211 | Print, at the given, optional 'indent', with the given optional |
paulb@81 | 212 | 'continuation' text, either to the given, optional 'stream' or to |
paulb@81 | 213 | standard output, this node's "pretty" representation along with its |
paulb@81 | 214 | children and their "pretty" representation (and so on). |
paulb@81 | 215 | """ |
paulb@81 | 216 | |
paulb@60 | 217 | stream = stream or sys.stdout |
paulb@60 | 218 | self._pprint(indent, continuation, repr(self), stream) |
paul@0 | 219 | |
paulb@47 | 220 | # Subprogram-related details. |
paul@0 | 221 | |
paul@0 | 222 | if hasattr(self, "params"): |
paul@0 | 223 | for name, default in self.params: |
paulb@75 | 224 | self._pprint(indent + 2, "( ", "%s default %s" % (name, default), stream=stream) |
paulb@24 | 225 | if hasattr(self, "star") and self.star: |
paulb@24 | 226 | name, default = self.star |
paulb@75 | 227 | self._pprint(indent + 2, "( ", "%s default %s" % (name, default), stream=stream) |
paulb@24 | 228 | if hasattr(self, "dstar") and self.dstar: |
paulb@24 | 229 | name, default = self.dstar |
paulb@75 | 230 | self._pprint(indent + 2, "( ", "%s default %s" % (name, default), stream=stream) |
paulb@112 | 231 | if getattr(self, "internal", 0): |
paulb@112 | 232 | self._pprint(indent + 2, "( ", "internal", stream=stream) |
paulb@18 | 233 | if getattr(self, "structure", 0): |
paulb@60 | 234 | self._pprint(indent + 2, "( ", "structure '%s'" % self.structure.name, stream=stream) |
paulb@47 | 235 | |
paulb@47 | 236 | # Expression-related details. |
paulb@47 | 237 | |
paul@0 | 238 | if hasattr(self, "expr"): |
paulb@60 | 239 | self.expr.pprint(indent + 2, "- ", stream=stream) |
paul@1 | 240 | if hasattr(self, "nodes"): |
paul@1 | 241 | for node in self.nodes: |
paulb@60 | 242 | node.pprint(indent + 2, "- ", stream=stream) |
paul@0 | 243 | if hasattr(self, "lvalue"): |
paulb@60 | 244 | self.lvalue.pprint(indent + 2, "->", stream=stream) |
paulb@47 | 245 | if hasattr(self, "nstype"): |
paulb@60 | 246 | self._pprint(indent + 2, "", self.nstype, stream=stream) |
paul@0 | 247 | if hasattr(self, "args"): |
paulb@99 | 248 | for arg in self.pos_args: |
paulb@60 | 249 | arg.pprint(indent + 2, "( ", stream=stream) |
paulb@99 | 250 | for name, arg in self.kw_args.items(): |
paulb@153 | 251 | arg.pprint(indent + 2, "( ", stream=stream) |
paulb@24 | 252 | if hasattr(self, "star") and self.star: |
paulb@60 | 253 | self.star.pprint(indent + 2, "( ", stream=stream) |
paulb@24 | 254 | if hasattr(self, "dstar") and self.dstar: |
paulb@60 | 255 | self.dstar.pprint(indent + 2, "( ", stream=stream) |
paul@0 | 256 | |
paulb@133 | 257 | # Statement-related details. |
paulb@133 | 258 | |
paulb@133 | 259 | if hasattr(self, "test"): |
paulb@133 | 260 | self.test.pprint(indent + 2, "? ", stream=stream) |
paulb@133 | 261 | for attr in "code", "body", "else_", "handler", "finally_", "choices": |
paulb@133 | 262 | if hasattr(self, attr) and getattr(self, attr): |
paulb@133 | 263 | self._pprint(indent, "", "%s {" % attr, stream=stream) |
paulb@133 | 264 | for node in getattr(self, attr): |
paulb@133 | 265 | node.pprint(indent + 2, stream=stream) |
paulb@133 | 266 | self._pprint(indent, "", "}", stream=stream) |
paulb@133 | 267 | |
paulb@39 | 268 | # Annotations. |
paulb@39 | 269 | |
paulb@39 | 270 | if hasattr(self, "accesses"): |
paulb@60 | 271 | self._pprint(indent, "", "--------", stream=stream) |
paulb@39 | 272 | for ref, attributes in self.accesses.items(): |
paulb@60 | 273 | self._pprint(indent + 2, "| ", "when %s: %s" % (ref, ", ".join([("%s via %s" % attr_acc) for attr_acc in attributes])), stream=stream) |
paulb@60 | 274 | self._pprint(indent, "", "--------", stream=stream) |
paulb@57 | 275 | if hasattr(self, "writes"): |
paulb@60 | 276 | self._pprint(indent, "", "--------", stream=stream) |
paulb@57 | 277 | for ref, attribute in self.writes.items(): |
paulb@60 | 278 | self._pprint(indent + 2, "| ", "when %s: %s" % (ref, attribute), stream=stream) |
paulb@60 | 279 | self._pprint(indent, "", "--------", stream=stream) |
paulb@39 | 280 | |
paulb@109 | 281 | # These are the supported "operations" described by simplified program nodes. |
paulb@109 | 282 | |
paul@0 | 283 | class Pass(Node): "A placeholder node corresponding to pass." |
paul@0 | 284 | class Assign(Node): "A grouping node for assignment-related operations." |
paul@0 | 285 | class Keyword(Node): "A grouping node for keyword arguments." |
paul@1 | 286 | class Global(Node): "A global name designator." |
paul@3 | 287 | class Import(Node): "A module import operation." |
paul@0 | 288 | class LoadTemp(Node): "Load a previously-stored temporary value." |
paul@0 | 289 | class LoadName(Node): "Load a named object." |
paul@0 | 290 | class LoadAttr(Node): "Load an object attribute." |
paulb@34 | 291 | class LoadRef(Node): "Load a reference, typically a subprogram or a constant." |
paul@0 | 292 | class LoadExc(Node): "Load a handled exception." |
paulb@133 | 293 | class CheckExc(Node): "Check a handled exception." |
paul@0 | 294 | class StoreTemp(Node): "Store a temporary value." |
paul@0 | 295 | class StoreName(Node): "Associate a name with an object." |
paul@0 | 296 | class StoreAttr(Node): "Associate an object's attribute with a value." |
paul@0 | 297 | class ReleaseTemp(Node): "Release a temporary value." |
paul@0 | 298 | class Try(Node): "A try...except...else...finally grouping node." |
paul@5 | 299 | class Raise(Node): "An exception raising node." |
paul@1 | 300 | class Not(Node): "A negation of an expression." |
paulb@28 | 301 | |
paulb@135 | 302 | # There are two types of return node: return from function and return from |
paulb@135 | 303 | # block. |
paulb@135 | 304 | |
paulb@135 | 305 | class Return(Node): |
paulb@135 | 306 | |
paulb@135 | 307 | "Return an evaluated expression." |
paulb@135 | 308 | |
paulb@135 | 309 | pass |
paulb@135 | 310 | |
paulb@135 | 311 | class ReturnFromFunction(Return): |
paulb@135 | 312 | pass |
paulb@135 | 313 | |
paulb@135 | 314 | class ReturnFromBlock(Return): |
paulb@135 | 315 | pass |
paulb@135 | 316 | |
paulb@133 | 317 | # Some behaviour is set as the default in conditional nodes but may be |
paulb@133 | 318 | # overridden. |
paulb@133 | 319 | |
paulb@133 | 320 | class Conditional(Node): |
paulb@133 | 321 | |
paulb@133 | 322 | "A conditional node consisting of a test and outcomes." |
paulb@133 | 323 | |
paulb@133 | 324 | def __init__(self, *args, **kw): |
paulb@133 | 325 | self.isolate_test = 0 |
paulb@133 | 326 | Node.__init__(self, *args, **kw) |
paulb@133 | 327 | |
paulb@67 | 328 | # Invocations involve some more work to process calculated attributes. |
paulb@67 | 329 | |
paulb@147 | 330 | class Invoke(Node): |
paulb@147 | 331 | |
paulb@147 | 332 | "An invocation." |
paulb@147 | 333 | |
paulb@147 | 334 | pass |
paulb@147 | 335 | |
paulb@67 | 336 | class InvokeFunction(Invoke): |
paulb@67 | 337 | |
paulb@67 | 338 | "A function or method invocation." |
paulb@67 | 339 | |
paulb@67 | 340 | def __init__(self, *args, **kw): |
paulb@148 | 341 | self.args = [] |
paulb@148 | 342 | self.star = None |
paulb@148 | 343 | self.dstar = None |
paulb@112 | 344 | Invoke.__init__(self, *args, **kw) |
paulb@148 | 345 | self.set_args(self.args) |
paulb@112 | 346 | self.share_locals = 0 |
paulb@67 | 347 | |
paulb@67 | 348 | def set_args(self, args): |
paulb@67 | 349 | |
paulb@67 | 350 | "Sort the 'args' into positional and keyword arguments." |
paulb@67 | 351 | |
paulb@67 | 352 | self.pos_args = [] |
paulb@99 | 353 | self.kw_args = {} |
paulb@67 | 354 | add_kw = 0 |
paulb@67 | 355 | for arg in args: |
paulb@67 | 356 | if not add_kw: |
paulb@67 | 357 | if not isinstance(arg, Keyword): |
paulb@67 | 358 | self.pos_args.append(arg) |
paulb@67 | 359 | else: |
paulb@67 | 360 | add_kw = 1 |
paulb@67 | 361 | if add_kw: |
paulb@67 | 362 | if isinstance(arg, Keyword): |
paulb@154 | 363 | self.kw_args[arg.name] = arg.expr |
paulb@67 | 364 | else: |
paulb@67 | 365 | raise TypeError, "Positional argument appears after keyword arguments in '%s'." % self |
paulb@67 | 366 | |
paulb@112 | 367 | class InvokeBlock(Invoke): |
paulb@112 | 368 | |
paulb@112 | 369 | "A block or loop invocation." |
paulb@112 | 370 | |
paulb@112 | 371 | def __init__(self, *args, **kw): |
paulb@112 | 372 | self.share_locals = 1 |
paulb@112 | 373 | Invoke.__init__(self, *args, **kw) |
paulb@67 | 374 | |
paulb@67 | 375 | # Named nodes are those which can be referenced in some way. |
paulb@67 | 376 | |
paulb@67 | 377 | class WithName: |
paulb@67 | 378 | |
paulb@67 | 379 | "Node naming." |
paulb@67 | 380 | |
paulb@67 | 381 | def __init__(self): |
paulb@79 | 382 | self._full_name = name(self, self.name or "$untitled") |
paulb@79 | 383 | |
paulb@79 | 384 | def full_name(self): |
paulb@79 | 385 | return self._full_name |
paulb@67 | 386 | |
paulb@109 | 387 | # Program structure nodes. |
paulb@109 | 388 | |
paulb@91 | 389 | class Module(Node): |
paulb@67 | 390 | |
paulb@67 | 391 | "A Python module." |
paulb@67 | 392 | |
paulb@91 | 393 | def full_name(self): |
paulb@99 | 394 | return "module %s" % self.name |
paulb@67 | 395 | |
paulb@67 | 396 | class Subprogram(Node, WithName): |
paulb@67 | 397 | |
paulb@67 | 398 | "A subprogram: functions, methods and loops." |
paulb@67 | 399 | |
paulb@67 | 400 | def __init__(self, *args, **kw): |
paulb@67 | 401 | Node.__init__(self, *args, **kw) |
paulb@67 | 402 | WithName.__init__(self) |
paulb@67 | 403 | |
paulb@28 | 404 | # Special non-program nodes. |
paulb@28 | 405 | |
paulb@67 | 406 | class Structure(Node): "A non-program node containing some kind of namespace." |
paulb@28 | 407 | |
paulb@67 | 408 | class Class(Structure, WithName): |
paulb@34 | 409 | |
paulb@34 | 410 | "A Python class." |
paulb@34 | 411 | |
paulb@60 | 412 | def __init__(self, *args, **kw): |
paulb@60 | 413 | Structure.__init__(self, *args, **kw) |
paulb@67 | 414 | WithName.__init__(self) |
paulb@91 | 415 | self.instances = [] |
paulb@67 | 416 | |
paulb@99 | 417 | def full_name(self): |
paulb@99 | 418 | return "class %s" % self._full_name |
paulb@99 | 419 | |
paulb@72 | 420 | class Instance(Structure): |
paulb@72 | 421 | |
paulb@72 | 422 | "An instance." |
paulb@72 | 423 | |
paulb@79 | 424 | def full_name(self): |
paulb@91 | 425 | # NOTE: Wrap the result in a call to name(self, ...) where multiple |
paulb@91 | 426 | # NOTE: instances per class can occur. |
paulb@133 | 427 | return self.get_class()._full_name |
paulb@133 | 428 | |
paulb@133 | 429 | def get_class(self): |
paulb@133 | 430 | return self.namespace.load("__class__")[0].type |
paulb@79 | 431 | |
paulb@72 | 432 | def __repr__(self): |
paulb@79 | 433 | return "Instance of type '%s'" % self.full_name() |
paulb@34 | 434 | |
paulb@91 | 435 | def __eq__(self, other): |
paulb@91 | 436 | # NOTE: Assuming that multiple instances of the same class are equal. |
paulb@91 | 437 | return self.full_name() == other.full_name() |
paulb@91 | 438 | |
paulb@91 | 439 | def __hash__(self): |
paulb@91 | 440 | return id(self) |
paulb@91 | 441 | |
paulb@34 | 442 | class Constant(Instance): |
paulb@34 | 443 | |
paulb@34 | 444 | "A constant initialised with a type name for future processing." |
paulb@34 | 445 | |
paulb@60 | 446 | def __init__(self, *args, **kw): |
paulb@60 | 447 | Instance.__init__(self, *args, **kw) |
paulb@34 | 448 | self.typename = self.value.__class__.__name__ |
paulb@19 | 449 | |
paul@0 | 450 | # vim: tabstop=4 expandtab shiftwidth=4 |