micropython

Change of micropython/data.py

687:f0579287fd69
micropython/data.py syspython-as-target
     1.1 --- a/micropython/data.py	Wed Oct 09 01:25:53 2013 +0200
     1.2 +++ b/micropython/data.py	Wed Oct 09 01:27:11 2013 +0200
     1.3 @@ -1497,7 +1497,13 @@
     1.4      original_name = name
     1.5  
     1.6      if parent.has_key(name):
     1.7 -        name = "%s#%d" % (name, parent[name].assignments + 1)
     1.8 +        # NOTE: Handle AtLeast(n) situations, such as in cases where modules
     1.9 +        # NOTE: may mutate others (doctest "monkeypatching" linecache, for
    1.10 +        # NOTE: example).
    1.11 +        assignments = parent[name].assignments
    1.12 +        if isinstance(assignments, AtLeast):
    1.13 +            assignments = assignments.count
    1.14 +        name = "%s#%d" % (name, assignments + 1)
    1.15  
    1.16      fn = Function(name, parent, argnames, defaults, has_star, has_dstar,
    1.17          dynamic_def, module, node, original_name)