pymemcache icon indicating copy to clipboard operation
pymemcache copied to clipboard

_parse_hex function should declare the base as 16 not 8

Open redorff opened this issue 9 months ago • 3 comments

https://github.com/pinterest/pymemcache/issues/633

redorff avatar Mar 10 '25 15:03 redorff

It looks like some users of this function were expecting the octal behavior.

jparise avatar Mar 14 '25 12:03 jparise

Ok, then, shouldn't the function be called "_parse_oct" rather than "_parse_hex" ?

redorff avatar Mar 14 '25 13:03 redorff

Ok, then, shouldn't the function be called "_parse_oct" rather than "_parse_hex" ?

I think so. Or there should be two functions, and the callers should use the one they need.

I also don't see a reason why the callers couldn't just use int(...) directly.

jparise avatar Mar 14 '25 13:03 jparise