1- from typing import Union , List , Tuple
1+ from typing import Optional , Union , List , Tuple
22
33import arcade .gl as gl
44from arcade .background import Background
@@ -11,7 +11,7 @@ class BackgroundGroup:
1111 The offset of the BackgroundGroup is the same as each background.
1212 """
1313
14- def __init__ (self , backgrounds : List [Background ] = None ):
14+ def __init__ (self , backgrounds : Optional [ List [Background ] ] = None ):
1515 self ._backgrounds : List [Background ] = [] if backgrounds is None else backgrounds
1616
1717 self ._pos = (0.0 , 0.0 )
@@ -63,16 +63,16 @@ def add_from_file(
6363 self ,
6464 tex_src : str ,
6565 pos : Tuple [float , float ] = (0.0 , 0.0 ),
66- size : Tuple [int , int ] = None ,
66+ size : Optional [ Tuple [int , int ] ] = None ,
6767 offset : Tuple [float , float ] = (0.0 , 0.0 ),
6868 scale : float = 1.0 ,
6969 angle : float = 0.0 ,
7070 * ,
7171 filters = (gl .NEAREST , gl .NEAREST ),
72- color : Tuple [int , int , int ] = None ,
73- color_norm : Tuple [float , float , float ] = None ,
74- shader : gl .Program = None ,
75- geometry : gl .Geometry = None
72+ color : Optional [ Tuple [int , int , int ] ] = None ,
73+ color_norm : Optional [ Tuple [float , float , float ] ] = None ,
74+ shader : Optional [ gl .Program ] = None ,
75+ geometry : Optional [ gl .Geometry ] = None
7676 ):
7777 background = Background .from_file (
7878 tex_src ,
@@ -100,7 +100,7 @@ class ParallaxGroup:
100100 """
101101
102102 def __init__ (
103- self , backgrounds : List [Background ] = None , depths : List [float ] = None
103+ self , backgrounds : Optional [ List [Background ]] = None , depths : Optional [ List [float ] ] = None
104104 ):
105105 self ._backgrounds : List [Background ] = [] if backgrounds is None else backgrounds
106106 self ._depths : List [float ] = [] if depths is None else depths
@@ -168,17 +168,17 @@ def add_from_file(
168168 self ,
169169 tex_src : str ,
170170 pos : Tuple [float , float ] = (0.0 , 0.0 ),
171- size : Tuple [int , int ] = None ,
171+ size : Optional [ Tuple [int , int ] ] = None ,
172172 depth : float = 1 ,
173173 offset : Tuple [float , float ] = (0.0 , 0.0 ),
174174 scale : float = 1.0 ,
175175 angle : float = 0.0 ,
176176 * ,
177177 filters = (gl .NEAREST , gl .NEAREST ),
178- color : Tuple [int , int , int ] = None ,
179- color_norm : Tuple [float , float , float ] = None ,
180- shader : gl .Program = None ,
181- geometry : gl .Geometry = None
178+ color : Optional [ Tuple [int , int , int ] ] = None ,
179+ color_norm : Optional [ Tuple [float , float , float ] ] = None ,
180+ shader : Optional [ gl .Program ] = None ,
181+ geometry : Optional [ gl .Geometry ] = None
182182 ):
183183 background = Background .from_file (
184184 tex_src ,
0 commit comments