polm / cutlet

Japanese to romaji converter in Python
https://polm.github.io/cutlet/
MIT License
286 stars 20 forks source link

Put use_foreign_spelling and ensure_ascii in constructor. #31

Closed PlaylistsTrance closed 1 year ago

PlaylistsTrance commented 2 years ago

Is there a reason why use_foreign_spelling=True, ensure_ascii=True are not in the Cutlet constructor __init__? Placing these in the constructor would help IDE software provide the user information about these modifiable attributes and their defaults, and it is more intuitive (for me at least) to write katsu = cutlet.Cutlet(use_foreign_spelling=False).

polm commented 2 years ago

Thanks for the suggestion, that's a good idea.

There's no specific reason it's not in the constructor, but the internal attributes were added as-needed while development was active. Since they seem reasonably stable now it should be fine to move some of them into the constructor.

polm commented 1 year ago

It took forever, but I just released 0.2.0 with this feature.

PlaylistsTrance commented 1 year ago

Hey, thanks for adding it to the constructor, but it looks like you forgot to use the constructor variables to set the class variables, see line 123. In the class, you have

        self.use_foreign_spelling = True
        self.ensure_ascii = True

instead of

        self.use_foreign_spelling = use_foreign_spelling
        self.ensure_ascii = ensure_ascii
polm commented 1 year ago

Well that's embarrassing, thanks for pointing it out. I just released 0.2.1, which should fix that.