Skip to content

Use Enums for restricted-input keyword arguments #1

@chris-maclean

Description

@chris-maclean

Many functions have keyword arguments that must be one of a few certain values. Currently PyWormbase is just putting the valid arguments in a list and verifying that this list contains the input. I can do better by putting the valid values into an enum and have the user pass an Enum value as the argument.

I can also have the function try to convert the kwarg to the appropriate Enum class if the arg is a string. That way, currently-working code won't break.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions