CircArgs commented on PR #4466:
URL: https://github.com/apache/iceberg/pull/4466#issuecomment-1106714989

   Hey @rdblue I wanted to circle back on the original without raising the 
error. I threw it in without considering the implications based on your 
suggestion, but I feel as though we still don't need such a thing. When one 
creates an `And` for example, it will call `__new__` and run through the logic 
on whether we are dealing with a tautology or a contradiction and yield 
`AlwaysTrue` or `AlwaysFalse` respectively. This logic, in conjunction with 
taking in `*rest` and reducing to binary `And`s makes us have to return and 
that's why I'm using `__new__`. Take this example:
   
   ```python
   class A:
       def __new__(cls):
           return B()
       def __init__(self):
           print('A init')
           
   class B:
       def __init__(self):
           print('B init')
   
   A()
   >>> "B init"
   
   So A's `__new__` was called but the resulting object was a B so its 
`__init__` was called. I'm just showing how `__new__` has full control here and 
that `And`'s `__init__` will only ever see what `__new__` wants it to see. As 
for what happens via possible calls to `super` from child classes, do we have 
to worry about that? I believed these classes would not be inherited from and 
if they were it is the user's responsibility to understand the implications 
especially when dealing with dunder methods.
   ```


-- 
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