[ports2data] add note about using id rather than name
This commit is contained in:
parent
ea93a7ef37
commit
d307589995
1 changed files with 2 additions and 0 deletions
|
|
@ -86,6 +86,8 @@ def data_to_ports(
|
||||||
if visited is None:
|
if visited is None:
|
||||||
visited = set()
|
visited = set()
|
||||||
|
|
||||||
|
# Note: visited uses id(pattern) to detect cycles and avoid redundant processing.
|
||||||
|
# This may not catch identical patterns if they are loaded as separate object instances.
|
||||||
if id(pattern) in visited:
|
if id(pattern) in visited:
|
||||||
return pattern
|
return pattern
|
||||||
visited.add(id(pattern))
|
visited.add(id(pattern))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue