fox-it / flow.record

Recordization library
GNU Affero General Public License v3.0
7 stars 9 forks source link

Add path __eq__ and __repr__ QOL changes #79

Closed Schamper closed 1 year ago

Schamper commented 1 year ago

Allow comparison to strings, as well as remove the class name from the repr output.

codecov[bot] commented 1 year ago

Codecov Report

Merging #79 (034b331) into main (ddea907) will increase coverage by 0.09%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
+ Coverage   79.00%   79.09%   +0.09%     
==========================================
  Files          32       32              
  Lines        2881     2894      +13     
==========================================
+ Hits         2276     2289      +13     
  Misses        605      605              
Flag Coverage Δ
unittests 79.09% <100.00%> (+0.09%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
flow/record/fieldtypes/__init__.py 91.93% <100.00%> (+0.24%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

Schamper commented 1 year ago

Also, since we are changing the repr output, would we prefer:

repr output: <test/path path="c:/windows/test.exe">

or:

str output: <test/path path="c:\windows\test.exe">

I thought about this before and I think I prefer the latter (str output). However to make the quoting of repr() work correctly I had to emulate that behaviour in pure Python. Using repr() directly would result in the \\ getting escaped to \\\\.

yunzheng commented 1 year ago

LGTM