This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cheryl.sabella
Recipients cheryl.sabella, serhiy.storchaka, terry.reedy
Date 2018-02-24.18:23:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519496603.03.0.467229070634.issue32880@psf.upfronthosting.co.za>
In-reply-to
Content
I also timed this for a `_tran` optimization (instead of looping and doing the `ord`), but it didn't really make a difference.
```
_tran = defaultdict(lambda: 'x')
_tran.update({40: 40,    # ord('(')
              91: 40,    # ord('[')
              123: 40,   # ord('{')
              41: 41,    # ord(')')
              93: 41,    # ord(']')
              125: 41,   # ord('}')
              34: 34,    # ord('"')
              39: 39,    # ord("'")
              92: 92,    # ord("\\")
              10: 10,    # ord("\n")
              35: 35,    # ord("#")
              })
```
I think both the loop and the above mapping are equally difficult to understand without stopping to think about it.
History
Date User Action Args
2018-02-24 21:22:09terry.reedyunlinkissue32880 messages
2018-02-24 18:23:23cheryl.sabellasetrecipients: + cheryl.sabella, terry.reedy, serhiy.storchaka
2018-02-24 18:23:23cheryl.sabellasetmessageid: <1519496603.03.0.467229070634.issue32880@psf.upfronthosting.co.za>
2018-02-24 18:23:23cheryl.sabellalinkissue32880 messages
2018-02-24 18:23:22cheryl.sabellacreate