python-ksuid icon indicating copy to clipboard operation
python-ksuid copied to clipboard

Simplify imports

Open ericbn opened this issue 1 year ago • 1 comments

No need to re-import datetime as datetime_lib inside __init__, just import it as that in the outer scope once. Import the typing members directly.

ericbn avatar Oct 28 '24 13:10 ericbn

We follow the t for typing and prefer not to rename when importing.

Hi @tasn. I sure can revert the changes in the typing import.

Regarding not renaming, you're already doing from datetime import datetime as datetime_lib inside __init__, because the argument is called datetime. I'd argue it's simpler to do that same from datetime import datetime as datetime_lib in the main scope, instead of hiding the first datetime import with the datetime argument and then importing datetime as datetime_lib every time again inside __init__.

EDIT: Just reverted the changes to the typing import.

ericbn avatar Oct 28 '24 14:10 ericbn