autowrap icon indicating copy to clipboard operation
autowrap copied to clipboard

Typehint issues

Open jpfeuffer opened this issue 1 year ago • 0 comments

  • [X] missing unicode leads to warnings when parsing types in a python 3 environment (maybe we should only use EITHER unicode or str, depending on the current version of python, or just ditch unicode from 2.7). EDIT: We ditched unicode.
  • [ ] pairs are currently types as List[t1,t2]. We probably should use namedtuples or recordclasses so we can type them correctly. Lists are homogeneous. See #168
  • [ ] attached classes seem to be typed with their hidden global types (_AttacheeClass_AttachedClass). (Might be fixable during doc generation) But we can check if it would be easier to just type with the attached type.
  • [ ] attached functions are currently typed via:
      class AASequence:
        ...
        fromString: __static_AASequence_fromString
    
    but mypy does not seem to like it. Transfer of types is apparently not easy. We might need to copy the whole signature.
  • [ ] typing of setters is missing. We type attributes though. It can get complicated to have different types for the properties (i.e. attributes) and their setters. E.g. if you use libcpp_utf8_string as a property it accepts str and bytes as setter but of course can only return one of them as getter. See also https://github.com/python/mypy/issues/3004
  • [ ] similar to the point before: We probably need to support input and output types (like we have input and output conversion code). This can then be used for asymmetric types that accept many python types but return only one (like OpenMS' String)

jpfeuffer avatar Sep 29 '22 08:09 jpfeuffer