Skip to content

Commit

Permalink
More logical casting example order
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesstidard committed Mar 26, 2017
1 parent b57e12c commit 3558af3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ class Color(Enum):
RED = 0
BLUE = 1

@EnvConfig.parse(Color)
def parse_color(value):
return Color[value.upper()]

class Config(EnvConfig):
THEME: Color = None

@Config.parse(Color)
def parse_color(value):
return Color[value.upper()]

print(Config.THEME) # <Color.BLUE: 0>
type(Config.THEME) # <enum 'Color'>
```

0 comments on commit 3558af3

Please sign in to comment.