Skip to content

Instantly share code, notes, and snippets.

@2tony2
Created May 22, 2024 07:39
Show Gist options
  • Select an option

  • Save 2tony2/5114ae0190022ee7b61032f1665f1ac3 to your computer and use it in GitHub Desktop.

Select an option

Save 2tony2/5114ae0190022ee7b61032f1665f1ac3 to your computer and use it in GitHub Desktop.
from enum import Enum
class Environment(Enum):
DEVELOPMENT = "development"
STAGING = "staging"
PRODUCTION = "production"
def set_environment(env: Environment) -> str:
return f"Environment set to {env.value}"
print(set_environment(Environment.DEVELOPMENT)) # Output: Environment set to development
print(set_environment(Environment.PRODUCTION)) # Output: Environment set to production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment