__init__(self,
extra_replacement_pairs=None,
separator=' - ' )
(Constructor)
|
|
Populate an instance with some defaults. The replacement dictionary
needs to be set such that the most specific replacements occur last.
This is because the replacements should be done in a certain order, for
example ('C:\', '') should be done before (':', '') and ('\', ''), and
because people tend to append to an iterable rather than prepend we will
traverse the iterable backwards.
- Parameters:
extra_replacement_pairs (list of tuples) - each tuple in this list contains a single replacement pair, i.e.
a single substring to be replaced and a single substring to
replace it.
separator (str) - in the case of non-unique strings this is the string that
separates the non-unique part from the number of times used which
is the unique part.
- Overrides:
object.__init__
|