Changes between Initial Version and Version 1 of Ticket #27308, comment 2


Ignore:
Timestamp:
Oct 3, 2016, 5:24:17 PM (8 years ago)
Author:
Gustavo J. A. M. Carneiro

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27308, comment 2

    initial v1  
    66The main point is to catch bugs due to mixing bytes vs str.  Also, how many times have you done in Python 3 this type of bug:
    77{{{
    8 >>> def create_key(param1):
     8>>> def create_redis_key(param1):
    99...     return "foo:bar:" + str(param1)
    1010...
     
    1414But if param1 comes from e.g. a network socket and you forget to decode the bytes:
    1515{{{
    16 >>> create_key(b"zbr")
     16>>> create_redis_key(b"zbr")
    1717"foo:bar:b'zbr'"
    1818}}}
Back to Top