Skip to content

Make numba.types.Optional __str__ less verbose. - #7583

Merged
sklam merged 1 commit into
numba:masterfrom
stuartarchibald:wip/less_verbose_optional_str
Nov 19, 2021
Merged

sklam merged 1 commit into
numba:masterfrom
stuartarchibald:wip/less_verbose_optional_str

Conversation

@stuartarchibald

Copy link
Copy Markdown
Contributor

As title. Whilst well intentioned, the verbose string repr makes
it harder to debug issues with Optional types.

As title. Whilst well intentioned, the verbose string repr makes
it harder to debug issues with Optional types.
@stuartarchibald

Copy link
Copy Markdown
Contributor Author

Impact on the representation is as follows:
Without this patch:

$ python -c 'from numba import types; print(types.Optional(types.float64))'
OptionalType(float64) i.e. the type 'float64 or None'

With this patch:

$ python -c 'from numba import types; print(types.Optional(types.float64))'
OptionalType(float64)

@stuartarchibald stuartarchibald added this to the Numba 0.55 RC milestone Nov 19, 2021

@sklam sklam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stuartarchibald stuartarchibald added 5 - Ready to merge Review and testing done, is ready to merge and removed 3 - Ready for Review labels Nov 19, 2021
@sklam
sklam merged commit 8215dff into numba:master Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge Effort - short Short size effort needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants