Closed tristan-ovh closed 7 years ago
Hi, I don't know if it is an expected behaviour, but it does not seem to be when reading the doc.
It seems that the prefix size is not taken into account when doing a lookup:
>>> tree = pytricia.PyTricia() >>> tree["0.0.0.0/0"] = 1 >>> tree["1.0.0.0/16"] = 2 >>> tree["1.0.0.0/8"] 2 >>> tree["1.1.0.0/8"] 1
I would expect the two last lines to return 1, as an 8 bits prefix cannot match a 16 bits prefix.
Just to reference the small fix I found, I created PR #17
Thanks -- just merged this.
Hi, I don't know if it is an expected behaviour, but it does not seem to be when reading the doc.
It seems that the prefix size is not taken into account when doing a lookup:
I would expect the two last lines to return 1, as an 8 bits prefix cannot match a 16 bits prefix.