We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8a6de11 + 3cebffe commit 1ce77ffCopy full SHA for 1ce77ff
python/ql/src/semmle/python/objects/Sequences.qll
@@ -53,7 +53,13 @@ abstract class TupleObjectInternal extends SequenceObjectInternal {
53
}
54
55
private string item(int n) {
56
- result = this.getItem(n).toString()
+ exists(ObjectInternal item | item = this.getItem(n) |
57
+ // To avoid infinite recursion, nested tuples are replaced with the string "...".
58
+ if item instanceof TupleObjectInternal then
59
+ result = "(...)"
60
+ else
61
+ result = item.toString()
62
+ )
63
or
64
n in [0..this.length()-1] and
65
not exists(this.getItem(n)) and result = "?"
0 commit comments