jun-he commented on a change in pull request #4016:
URL: https://github.com/apache/iceberg/pull/4016#discussion_r796876298



##########
File path: python/src/iceberg/types.py
##########
@@ -82,7 +122,23 @@ def scale(self) -> int:
         return self._scale
 
 
-class NestedField(object):
+class NestedField(Type):
+    """equivalent of `NestedField` type from Java implementation"""
+
+    _implemented: Dict[Tuple[bool, int, str, Type, Optional[str]], 
"NestedField"] = {}
+
+    def __new__(
+        cls,
+        is_optional: bool,
+        field_id: int,
+        name: str,
+        field_type: Type,
+        doc: Optional[str] = None,
+    ):
+        key = is_optional, field_id, name, field_type, doc
+        cls._implemented[key] = cls._implemented.get(key, object.__new__(cls))

Review comment:
       In this line, will it always create a new object, `object.__new__(cls)` 
and pass it to get method call?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to