~jasper/type_stack_calc

ref: 6aca66fb1a7cf1e10f7dd3263f04537c8ff37590 type_stack_calc/type_stack_calc/base/ided.py -rw-r--r-- 177 bytes
6aca66fb — Jasper den Ouden Apparently `to_c` can already read ahead one, hopefully its this simple... 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
class Ided:
    """Gives a class a counter for for-class unique IDs"""
    cnt = 0
    def __init__(self):
        tp = type(self)
        self.id = tp.cnt
        tp.cnt += 1