11from __future__ import annotations
22
3- import typing
43from collections .abc import Callable , Mapping
54
65from openfeature ._backports .strenum import StrEnum
@@ -26,7 +25,7 @@ class OpenFeatureError(Exception):
2625 """
2726
2827 def __init__ (
29- self , error_code : ErrorCode , error_message : typing . Optional [ str ] = None
28+ self , error_code : ErrorCode , error_message : str | None = None
3029 ):
3130 """
3231 Constructor for the generic OpenFeatureError.
@@ -43,7 +42,7 @@ class ProviderNotReadyError(OpenFeatureError):
4342 This exception should be raised when the provider is not ready to be used.
4443 """
4544
46- def __init__ (self , error_message : typing . Optional [ str ] = None ):
45+ def __init__ (self , error_message : str | None = None ):
4746 """
4847 Constructor for the ProviderNotReadyError. The error code for this type of
4948 exception is ErrorCode.PROVIDER_NOT_READY.
@@ -58,7 +57,7 @@ class ProviderFatalError(OpenFeatureError):
5857 This exception should be raised when the provider encounters a fatal error.
5958 """
6059
61- def __init__ (self , error_message : typing . Optional [ str ] = None ):
60+ def __init__ (self , error_message : str | None = None ):
6261 """
6362 Constructor for the ProviderFatalError. The error code for this type of
6463 exception is ErrorCode.PROVIDER_FATAL.
@@ -74,7 +73,7 @@ class FlagNotFoundError(OpenFeatureError):
7473 key provided by the user.
7574 """
7675
77- def __init__ (self , error_message : typing . Optional [ str ] = None ):
76+ def __init__ (self , error_message : str | None = None ):
7877 """
7978 Constructor for the FlagNotFoundError. The error code for
8079 this type of exception is ErrorCode.FLAG_NOT_FOUND.
@@ -90,7 +89,7 @@ class GeneralError(OpenFeatureError):
9089 feature python sdk.
9190 """
9291
93- def __init__ (self , error_message : typing . Optional [ str ] = None ):
92+ def __init__ (self , error_message : str | None = None ):
9493 """
9594 Constructor for the GeneralError. The error code for this type of exception
9695 is ErrorCode.GENERAL.
@@ -106,7 +105,7 @@ class ParseError(OpenFeatureError):
106105 be parsed into a FlagEvaluationDetails object.
107106 """
108107
109- def __init__ (self , error_message : typing . Optional [ str ] = None ):
108+ def __init__ (self , error_message : str | None = None ):
110109 """
111110 Constructor for the ParseError. The error code for this type of exception
112111 is ErrorCode.PARSE_ERROR.
@@ -122,7 +121,7 @@ class TypeMismatchError(OpenFeatureError):
122121 not match the type requested by the user.
123122 """
124123
125- def __init__ (self , error_message : typing . Optional [ str ] = None ):
124+ def __init__ (self , error_message : str | None = None ):
126125 """
127126 Constructor for the TypeMismatchError. The error code for this type of
128127 exception is ErrorCode.TYPE_MISMATCH.
@@ -138,7 +137,7 @@ class TargetingKeyMissingError(OpenFeatureError):
138137 but one was not provided in the evaluation context.
139138 """
140139
141- def __init__ (self , error_message : typing . Optional [ str ] = None ):
140+ def __init__ (self , error_message : str | None = None ):
142141 """
143142 Constructor for the TargetingKeyMissingError. The error code for this type of
144143 exception is ErrorCode.TARGETING_KEY_MISSING.
@@ -154,7 +153,7 @@ class InvalidContextError(OpenFeatureError):
154153 requirements.
155154 """
156155
157- def __init__ (self , error_message : typing . Optional [ str ] ):
156+ def __init__ (self , error_message : str | None ):
158157 """
159158 Constructor for the InvalidContextError. The error code for this type of
160159 exception is ErrorCode.INVALID_CONTEXT.
0 commit comments