persiantools
persiantools copied to clipboard
unnecessary utility
It seems you don't need utils
at all.
You can use some kind of comprehension to make the code even much more readable and independent.
return ''.join(
dic.get(char, char) # maybe dic is not a good name though
for char in string
)
https://github.com/mhajiloo/persiantools/blob/a88112b5955cb8214e84467357bee61cc01242ba/persiantools/digits.py#L28