Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config_custom_install_location: Type hint improvements #460

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DavidoTek
Copy link
Owner

@DavidoTek DavidoTek commented Sep 20, 2024

Improves the type hint for util.py#config_custom_install_location. Changes dict[str, str] to dict[str, Any]

As it is the case in #457, the following scenario would result in a type error:

# Reminder: config_custom_install_location(install_dir=None, launcher='', remove=False)
>>> c = config_custom_install_location(remove=True)
>>> i = c.get("install_dir")
>>> print(i)
None
>>> i.split("/")
... AttributeError: 'NoneType' object has no attribute 'split'

That is the case because when remove=True, install_dir will be returned unchanged. The default value for install_dir is None.

An alternative is to change the default value of install_dir from None to ''.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant