ashb commented on code in PR #51153:
URL: https://github.com/apache/airflow/pull/51153#discussion_r2123795158


##########
task-sdk/src/airflow/sdk/__init__.py:
##########
@@ -126,3 +132,8 @@ def __getattr__(name: str):
         globals()[name] = val
         return val
     raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
+
+
+def __dir__() -> list[str]:
+    """Override dir() to expose only the public API names and internal 
attributes."""
+    return sorted(__all__ + ["__getattr__", "__lazy_imports"])

Review Comment:
   But what is calling `dir()` on the module? IDEs don't use this -- they'll 
use the pyi stub.
   
   Nothing outside of this module should need to know about these two things 
you added?



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