The replacement character itself does not matter, but the problem is safe_extra
does not normalise -
(and .
). Under safe_extra
rules, a£b
and a-b
are not equivalent—a£b
normalises to a_b
, and a-b
is a normalised form.
This is a problem for a package currently using -
in the extra name. For example, if a package declares an extra a-b
and dependency foo ; extra == 'a-b'
, pip install package[a_b]
currently does not install foo
, while a PEP-503-based rule will. This is more problematic if the package has both a-b
and a_b
declared as extras, although this is so fundamentally user-hostile I’d hope no package would do it. The same applies to .
; foo ; extra == 'a.b'
can currently be selected with [a.b]
, but PEP 503 would allow [a-b]
.
BTW, there an additional minor difference between safe_extra
and PEP 503 normalisation. PEP 503 specifies any running non-alphanumeric sequences be normalised into a single dash, which means a--b
becomes a-b
, but safe_extra
only replaces running non-safe sequences, so a__b
normalises to a__b
. But again, anyone relying on this is probably too user-hostile to be a meaningful consideration.