I feel @gribozavr had a valid point here.

Suggested alternative (validated to yield the same result):

```python
CHARMAP = 256 * ['_']  # default: map everything to _
for char in string.digits + string.ascii_letters:
    CHARMAP[ord(char)] = char
CHARMAP = ''.join(CHARMAP)  # collapse to a string
```

or single-line:

```python
CHARMAP = ''.join([('_', chr(i))[chr(i) in (string.digits + string.ascii_letters)] for i in range(0,256)])
```