Superskyyy commented on code in PR #232:
URL: https://github.com/apache/skywalking-python/pull/232#discussion_r957626749


##########
skywalking/trace/span.py:
##########
@@ -33,7 +32,24 @@
 
 
 @tostring
-class Span(ABC):
+class Span:
+    def __new__(
+            cls,
+            context: 'SpanContext',
+            sid: int = -1,
+            pid: int = -1,
+            op: str = None,
+            peer: str = None,
+            kind: Kind = None,
+            component: Component = None,
+            layer: Layer = None,
+            *args,
+            **kwargs,
+    ):
+        if cls is Span:
+            raise TypeError(f"only children of '{cls.__name__}' may be 
instantiated")
+        return super.__new__(cls, *args, **kwargs)

Review Comment:
   `super()`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to