cobrapy icon indicating copy to clipboard operation
cobrapy copied to clipboard

type hint changes in dictlist.py

Open akaviaLab opened this issue 2 years ago • 3 comments

  • [ ] fix #(issue number)
  • [X] description of feature/fix Changed type hints in dictlist to be TypeVar(Object), because otherwise my linter would complain about expecting a Reaction and getting Object from model.reactions.get_by_id(). Similarly for other interactions with dictlists. Doesn't change functionality.
  • [ ] tests added/passed
  • [X] add an entry to the next release

akaviaLab avatar Jul 26 '22 22:07 akaviaLab

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.41%. Comparing base (2d343e7) to head (b33ad79). Report is 93 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #1256      +/-   ##
==========================================
+ Coverage   84.31%   84.41%   +0.09%     
==========================================
  Files          66       66              
  Lines        5497     5498       +1     
  Branches     1265     1265              
==========================================
+ Hits         4635     4641       +6     
+ Misses        556      551       -5     
  Partials      306      306              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jul 26 '22 23:07 codecov-commenter

@cdiener - can you please review?

akaviaLab avatar Aug 10 '22 19:08 akaviaLab

Not an expert in type annotations. Looks a bit hacky to me. Could it not just by the Any type for the items in a DictList since it's a general purpose container?

cdiener avatar Aug 18 '22 23:08 cdiener