On 2/20/2012 1:33 PM, antoine.pitrou wrote: > http://hg.python.org/cpython/rev/c760bd844222 > changeset: 75058:c760bd844222 > user: Antoine Pitrou<solipsis at pitrou.net> > date: Mon Feb 20 19:30:23 2012 +0100 > summary: > Issue #13641: Decoding functions in the base64 module now accept ASCII-only unicode strings. > Patch by Catalin Iacob. > + tests = {b"d3d3LnB5dGhvbi5vcmc=": b"www.python.org", > + b'AA==': b'\x00', > + b"YQ==": b"a", > + b"YWI=": b"ab", > + b"YWJj": b"abc", > + b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" > + b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT" > + b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==": > + > + b"abcdefghijklmnopqrstuvwxyz" > + b"ABCDEFGHIJKLMNOPQRSTUVWXYZ" > + b"0123456789!@#0^&*();:<>,. []{}", > + b'': b'', > + } > + for data, res in tests.items(): I am a little puzzled why a constant sequence of pairs is being stored as a mapping instead of a tuple (or list) of 2-tuples (which is compiled more efficiently). As near as I can tell, 'tests' and similar constructs later in the file are never used as mappings. Am I missing something or is this just the way Catalin wrote it? -- Terry Jan Reedy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4