瀏覽代碼

remove "Literal" type (introduced in python 3.8)

Falko Schindler 3 年之前
父節點
當前提交
b9f35969b0
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      nicegui/elements/scene_object3d.py

+ 3 - 3
nicegui/elements/scene_object3d.py

@@ -1,7 +1,7 @@
 from __future__ import annotations
 
 import uuid
-from typing import List, Literal, Optional
+from typing import List, Optional
 
 import numpy as np
 from justpy.htmlcomponents import WebPage
@@ -22,7 +22,7 @@ class Object3D:
         self.args = list(args)
         self.color = '#ffffff'
         self.opacity = 1.0
-        self.side_: Literal['front', 'back', 'both'] = 'front'
+        self.side_: str = 'front'
         self.x = 0
         self.y = 0
         self.z = 0
@@ -80,7 +80,7 @@ class Object3D:
     def _delete_command(self):
         return f'delete("{self.id}")'
 
-    def material(self, color: str = '#ffffff', opacity: float = 1.0, side: Literal['front', 'back', 'both'] = 'front'):
+    def material(self, color: str = '#ffffff', opacity: float = 1.0, side: str = 'front'):
         if self.color != color or self.opacity != opacity or self.side_ != side:
             self.color = color
             self.opacity = opacity