ocket8888 commented on issue #3503: Comparison using is when operands support 
__eq__
URL: https://github.com/apache/trafficcontrol/pull/3503#issuecomment-484681524
 
 
   That is a good change, but an interesting tidbit: in CPython this actually 
works properly because the interpreter will cache numeric constants and short 
string constants at compile time. So assigning a variable to the value of a 
small string actually just points it at the existing object. Since strings and 
numbers are immutable, this is totally safe. But it's wrong to rely on 
implementation quirks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to