We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e58318 commit 6b3396fCopy full SHA for 6b3396f
src/kirin/idtable.py
@@ -32,6 +32,8 @@ class IdTable(Generic[T]):
32
"""The count of names that have been generated."""
33
next_id: int = 0
34
"""The next ID to use for generating names."""
35
+ alternate_prefix: str = ""
36
+ """An alternate prefix to use when the name is None."""
37
38
def add(self, value: T) -> str:
39
"""Add a value to the table and return the name."""
@@ -43,7 +45,7 @@ def add(self, value: T) -> str:
43
45
name = self.prefix + value_name + suffix
44
46
self.table[value] = name
47
else:
- name = f"{self.prefix}{id}"
48
+ name = f"{self.prefix}{self.alternate_prefix}{id}"
49
self.next_id += 1
50
51
return name
0 commit comments