@@ -149,21 +149,29 @@ class Application(SingletonConfigurable):
149149
150150 # The name of the application, will usually match the name of the command
151151 # line application
152- name : t .Union [str , Unicode ] = Unicode ("application" )
152+ name : t .Union [str , Unicode [ str , t . Union [ str , bytes ]] ] = Unicode ("application" )
153153
154154 # The description of the application that is printed at the beginning
155155 # of the help.
156- description : t .Union [str , Unicode ] = Unicode ("This is an application." )
156+ description : t .Union [str , Unicode [str , t .Union [str , bytes ]]] = Unicode (
157+ "This is an application."
158+ )
157159 # default section descriptions
158- option_description : t .Union [str , Unicode ] = Unicode (option_description )
159- keyvalue_description : t .Union [str , Unicode ] = Unicode (keyvalue_description )
160- subcommand_description : t .Union [str , Unicode ] = Unicode (subcommand_description )
160+ option_description : t .Union [str , Unicode [str , t .Union [str , bytes ]]] = Unicode (
161+ option_description
162+ )
163+ keyvalue_description : t .Union [str , Unicode [str , t .Union [str , bytes ]]] = Unicode (
164+ keyvalue_description
165+ )
166+ subcommand_description : t .Union [str , Unicode [str , t .Union [str , bytes ]]] = Unicode (
167+ subcommand_description
168+ )
161169
162170 python_config_loader_class = PyFileConfigLoader
163171 json_config_loader_class = JSONFileConfigLoader
164172
165173 # The usage and example string that goes at the end of the help string.
166- examples : t .Union [str , Unicode ] = Unicode ()
174+ examples : t .Union [str , Unicode [ str , t . Union [ str , bytes ]] ] = Unicode ()
167175
168176 # A sequence of Configurable subclasses whose config=True attributes will
169177 # be exposed at the command line.
@@ -190,30 +198,30 @@ def _classes_inc_parents(self, classes=None):
190198 yield parent
191199
192200 # The version string of this application.
193- version : t .Union [str , Unicode ] = Unicode ("0.0" )
201+ version : t .Union [str , Unicode [ str , t . Union [ str , bytes ]] ] = Unicode ("0.0" )
194202
195203 # the argv used to initialize the application
196204 argv : t .Union [t .List [str ], List ] = List ()
197205
198206 # Whether failing to load config files should prevent startup
199- raise_config_file_errors : t .Union [bool , Bool ] = Bool (
207+ raise_config_file_errors : t .Union [bool , Bool [ bool , t . Union [ bool , int ]] ] = Bool (
200208 TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR
201209 )
202210
203211 # The log level for the application
204- log_level : t .Union [str , int , Enum ] = Enum (
212+ log_level : t .Union [str , int , Enum [ t . Any , t . Any ] ] = Enum (
205213 (0 , 10 , 20 , 30 , 40 , 50 , "DEBUG" , "INFO" , "WARN" , "ERROR" , "CRITICAL" ),
206214 default_value = logging .WARN ,
207215 help = "Set the log level by value or name." ,
208216 ).tag (config = True )
209217
210218 _log_formatter_cls = LevelFormatter
211219
212- log_datefmt : t .Union [str , Unicode ] = Unicode (
220+ log_datefmt : t .Union [str , Unicode [ str , t . Union [ str , bytes ]] ] = Unicode (
213221 "%Y-%m-%d %H:%M:%S" , help = "The date format used by logging formatters for %(asctime)s"
214222 ).tag (config = True )
215223
216- log_format : t .Union [str , Unicode ] = Unicode (
224+ log_format : t .Union [str , Unicode [ str , t . Union [ str , bytes ]] ] = Unicode (
217225 "[%(name)s]%(highlevel)s %(message)s" ,
218226 help = "The Logging format template" ,
219227 ).tag (config = True )
@@ -420,11 +428,11 @@ def _log_default(self):
420428
421429 _loaded_config_files = List ()
422430
423- show_config : t .Union [bool , Bool ] = Bool (
431+ show_config : t .Union [bool , Bool [ bool , t . Union [ bool , int ]] ] = Bool (
424432 help = "Instead of starting the Application, dump configuration to stdout"
425433 ).tag (config = True )
426434
427- show_config_json : t .Union [bool , Bool ] = Bool (
435+ show_config_json : t .Union [bool , Bool [ bool , t . Union [ bool , int ]] ] = Bool (
428436 help = "Instead of starting the Application, dump configuration to stdout (as JSON)"
429437 ).tag (config = True )
430438
@@ -436,7 +444,7 @@ def _show_config_json_changed(self, change):
436444 def _show_config_changed (self , change ):
437445 if change .new :
438446 self ._save_start = self .start
439- self .start = self .start_show_config # type:ignore[method-assign ]
447+ self .start = self .start_show_config # type:ignore[assignment ]
440448
441449 def __init__ (self , ** kwargs ):
442450 SingletonConfigurable .__init__ (self , ** kwargs )
0 commit comments