diff options
Diffstat (limited to 'libs/rich/theme.py')
-rw-r--r-- | libs/rich/theme.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/rich/theme.py b/libs/rich/theme.py index 68b1ef3d2..bfb3c7f82 100644 --- a/libs/rich/theme.py +++ b/libs/rich/theme.py @@ -1,5 +1,5 @@ import configparser -from typing import Dict, List, IO, Mapping +from typing import Dict, List, IO, Mapping, Optional from .default_styles import DEFAULT_STYLES from .style import Style, StyleType @@ -15,7 +15,9 @@ class Theme: styles: Dict[str, Style] - def __init__(self, styles: Mapping[str, StyleType] = None, inherit: bool = True): + def __init__( + self, styles: Optional[Mapping[str, StyleType]] = None, inherit: bool = True + ): self.styles = DEFAULT_STYLES.copy() if inherit else {} if styles is not None: self.styles.update( @@ -35,7 +37,7 @@ class Theme: @classmethod def from_file( - cls, config_file: IO[str], source: str = None, inherit: bool = True + cls, config_file: IO[str], source: Optional[str] = None, inherit: bool = True ) -> "Theme": """Load a theme from a text mode file. |