SunilKumarPradhan commented on code in PR #4490:
URL: https://github.com/apache/iggy/pull/4490#discussion_r4283862538


##########
foreign/python/apache_iggy.pyi:
##########
@@ -3627,6 +3733,52 @@ class WebSocketReconnectionConfig:
         """
     def __repr__(self) -> builtins.str: ...
 
[email protected]
+class ClusterNodeRole(enum.Enum):

Review Comment:
    I dug into this one. Tested the exact construction we use, enum.Enum(name, 
members, type=str, module=...), and it does produce a real str backed Enum at 
runtime. .name and .value both work, iteration works, you can construct by 
value with ClusterNodeRole("leader"), and str equality works too 
(ClusterNodeRole.LEADER == "leader"). The test 
test_role_and_status_are_python_enums checks all four of those and passes. 
    
   This is the same pattern Durability already uses in durability.rs, so if 
there's an actual gap it's not new to this PR, it would apply there too. I'd 
rather not switch these to native pyo3 enums here since we'd lose .value, 
construct by value, and str equality, which the tests and callers both depend 
on, and pyo3 enums don't give us an easy equivalent. 
   
   Happy to open a separate issue for Durability if you can show a concrete 
case where it breaks. 



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

Reply via email to