datumaro icon indicating copy to clipboard operation
datumaro copied to clipboard

Update type definitions wrt new attrs features

Open zhiltsov-max opened this issue 3 years ago • 2 comments

Review and update extractor.py and other files.

Changed in version 21.1.0: init=False injects __attrs_init__

Should fix our class patching in Bbox.

zhiltsov-max avatar Jun 24 '21 11:06 zhiltsov-max

There are more things we can do:

  • utilize the new library API (https://www.attrs.org/en/stable/api.html#next-generation-apis): define, field, frozen
  • remove repr_ns in nested classes

Maybe, we can refactor Config using attrs, it would be very nice.

zhiltsov-max avatar Jul 23 '21 20:07 zhiltsov-max

FWIW, the attrs changelog promises that in the next release you'll be able to "import attrs", so I think we should wait and see what that's like before doing a mass refactoring. My assumption is that it'll be a package with just the new generation API in it, so it'll be easier to remove old API usage if we switch to it.

IRDonch avatar Jul 27 '21 18:07 IRDonch