1- from typing import Callable , List , Optional , Tuple
1+ from collections . abc import Callable
22
33
44class Blueprint :
@@ -13,9 +13,9 @@ class Blueprint:
1313 def __init__ (
1414 self ,
1515 name : str ,
16- url_prefix : Optional [ str ] = None ,
17- static_folder : Optional [ str ] = None ,
18- static_url_path : Optional [ str ] = None ,
16+ url_prefix : str | None = None ,
17+ static_folder : str | None = None ,
18+ static_url_path : str | None = None ,
1919 ):
2020 """
2121 Initializes a new Blueprint.
@@ -32,16 +32,16 @@ def __init__(
3232 """
3333 self .name = name
3434 self .url_prefix = url_prefix
35- self .routes : List [ Tuple [str , Callable , List [str ], str ]] = []
35+ self .routes : list [ tuple [str , Callable , list [str ], str ]] = []
3636 self .static_folder = static_folder
3737 self .static_url_path = static_url_path
3838
3939 def add_route (
4040 self ,
4141 path : str ,
4242 handler : Callable ,
43- methods : Optional [ List [ str ]] = None ,
44- endpoint : Optional [ str ] = None ,
43+ methods : list [ str ] | None = None ,
44+ endpoint : str | None = None ,
4545 ):
4646 """
4747 Programmatically adds a route to the blueprint.
@@ -67,8 +67,8 @@ def add_route(
6767 def route (
6868 self ,
6969 path : str ,
70- methods : Optional [ List [ str ]] = None ,
71- endpoint : Optional [ str ] = None ,
70+ methods : list [ str ] | None = None ,
71+ endpoint : str | None = None ,
7272 ) -> Callable :
7373 """
7474 A decorator to register a view function for a given path within the blueprint.
0 commit comments