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
After spending quite many hours in the codebase, there is one thing I find really confusing and time consuming: Some classes are named the same thing, but with different functions. Applies to Variable and partly to Array and Record.
variable.Variablepdo.base.Variable# Inherited from variable.Variablesdo.base.Variable# Inherited from variable.Variableobjectdictionary.Variable
I understand the functions for all of these. and I get it if the intention was to make a duck-type like class, but they're really not all compatible. It does not help that type checkers and linters often displays the base name of the class, not the full path. If the type checker report an error where it expects Variable, a small investigation is required to figure out which of these classes is the one that should be used.
I would like to suggest to change the class names into unique names as follows:
classVariable: # in variable.pyclassPdoVariable(Variable):
classSdoVariable(Variable):
classODVariable:
Likewise for Array into class SdoArray and class ODArray, and Record into class SdoRecord and class ODRecord. I don't intend any changes to the methods and the class inheritance. If we need to keep the old names intact for compatibility, we can do so as aliases in the respective files. I can spin up a PR if there's interest for this.
The text was updated successfully, but these errors were encountered:
To create better distinction between the different Variable, Record and Array types used for different purposes. Helps development, as IDE/linters often only display base name of class.
To create better distinction between the different Variable, Record and Array types used for different purposes. Helps development, as IDE/linters often only display base name of class.
After spending quite many hours in the codebase, there is one thing I find really confusing and time consuming: Some classes are named the same thing, but with different functions. Applies to
Variable
and partly toArray
andRecord
.I understand the functions for all of these. and I get it if the intention was to make a duck-type like class, but they're really not all compatible. It does not help that type checkers and linters often displays the base name of the class, not the full path. If the type checker report an error where it expects
Variable
, a small investigation is required to figure out which of these classes is the one that should be used.I would like to suggest to change the class names into unique names as follows:
Likewise for
Array
intoclass SdoArray
andclass ODArray
, andRecord
intoclass SdoRecord
andclass ODRecord
. I don't intend any changes to the methods and the class inheritance. If we need to keep the old names intact for compatibility, we can do so as aliases in the respective files. I can spin up a PR if there's interest for this.The text was updated successfully, but these errors were encountered: