Please restore the old pattern
if default:
# Register the group - don't do this before adding the deps in case that step fails.
if backend is BackendEnum.uv:
register_default_group(group)
elif backend is BackendEnum.none:
# This is not really a meaningful concept without a package manager
pass
else:
assert_never(backend)
The rationale being that this makes it safer in case we add a new backend, that we don't silently fail to add support for it here.
Originally posted by @nathanjmcdougall in #1589
We should explain not to remove this pattern when it is encountered, give examples of good and bad; and explain why it's positively helpful for enums in general.
Originally posted by @nathanjmcdougall in #1589
We should explain not to remove this pattern when it is encountered, give examples of good and bad; and explain why it's positively helpful for enums in general.