persiantools icon indicating copy to clipboard operation
persiantools copied to clipboard

unnecessary utility

Open GreatBahram opened this issue 5 years ago • 0 comments

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

GreatBahram avatar May 17 '19 15:05 GreatBahram