Although I think the ~ is a very ugly -, it could be useful to change the separator to something less commonly used than the -.

It would be useful to be able to use the hyphen - in the version of a package (for semver) and elsewhere. Using it as the separator could make parsing the file name a bit trickier than is healthy.

This change would affect PEP 376 which reads:

This distinct directory is named as follows::

    name + '-' + version + '.dist-info'


with today's hyphen/underscore folding: re.sub('[^A-Za-z0-9.]+', '-', version), could become


It would also affect pip, setuptools, and the wheel peps. If we do this, I would like to allow Unicode package names at the same time. safe_name(), the pkg_resources function that escapes package names for file names, would become

re.sub(u"[^\w.]+", "_", u"package-name", flags=re.U)

In other words, the rule for package names would be that they can contain any Unicode alphanumeric or _ or dot. Right now package names cannot practically contain non-ASCII because the setuptools installation will fold it all to _ and installation metadata will collide on the disk.

safe_version(), presently the same as safe_name() would also need to allow + for semver.

Does anyone have the energy to actually implement a proof-of-concept?