You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In multiple places in main.cpp, we import irods_types and irods_errors and then stuff them into an already-imported module's __dict__, with the intention of making them available in the imported module:
Modules are interpreted on import, before__dict__ can be changed by the C++ code doing the importing. Therefore, the modules are actually not available to any code executed on import.
Changing __dict__ of a module in this manner creates further inconsistency for when these modules are implicitly available and when they must first be imported.
import irods_types and import irods_errors work just fine. Users should be doing this instead of assuming they will already be imported. No magic pls.
Given that this would be a breaking change, we should first deprecate implicitly/magically imported irods_types and irods_errors before actually making the change.
The text was updated successfully, but these errors were encountered:
In multiple places in
main.cpp
, we importirods_types
andirods_errors
and then stuff them into an already-imported module's__dict__
, with the intention of making them available in the imported module:irods_rule_engine_plugin_python/src/main.cpp
Lines 556 to 562 in 0f5df8f
irods_rule_engine_plugin_python/src/main.cpp
Lines 717 to 727 in 0f5df8f
irods_rule_engine_plugin_python/src/main.cpp
Lines 851 to 861 in 0f5df8f
This is bad for a few reasons:
__dict__
can be changed by the C++ code doing the importing. Therefore, the modules are actually not available to any code executed on import.__dict__
of a module in this manner creates further inconsistency for when these modules are implicitly available and when they must first be imported.import irods_types
andimport irods_errors
work just fine. Users should be doing this instead of assuming they will already be imported. No magic pls.Given that this would be a breaking change, we should first deprecate implicitly/magically imported
irods_types
andirods_errors
before actually making the change.The text was updated successfully, but these errors were encountered: