Although I think the ~ is a very ugly -, it could be useful to change the separator to something less commonly used than the -.<br><br>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.<br>
<br>This change would affect PEP 376 which reads:<br><br>This distinct directory is named as follows::<br><br>    name + '-' + version + '.dist-info'<br><br>python_package-1.0.0_four+seven.dist-info<br><br>
with today's hyphen/underscore folding: re.sub('[^A-Za-z0-9.]+', '-', version), could become<br><br>python-package~1.0.0-four+seven.dist-info<br><br><br>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<br>
<br>re.sub(u"[^\w.]+", "_", u"package-name", flags=re.U)<br><br><br>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.<br>
<br>safe_version(), presently the same as safe_name() would also need to allow + for semver.<br><br><br>Does anyone have the energy to actually implement a proof-of-concept?<br>