-
Notifications
You must be signed in to change notification settings - Fork 302
Closed
Milestone
Description
The current initialization pattern looks like this:
import khaiii
api = khaiii.KhaiiiApi()
api.open()
Which effectively feels like a double construct. The issue is minor, but doesn't feel like idiomatic Python. Since calling the constructor is a contract that implies the caller is willing to do have the object ready, the second open() call feels rather odd. Same applies for the destructor, although this would be less of an issue since delete semantics are consistent and for most of the part the magical close() function will be obstructed away from the user.
What if, for example it worked like this by folding the two constructs into one?
from khaii import Khaiii
k = Khaii(library_path: str = '', resource_directory: str = '', options: dict = {})