ksindi / implements

:snake: Pythonic interfaces using decorators
http://implements.readthedocs.io/
Apache License 2.0
33 stars 4 forks source link

Collect Errors #21

Closed KyleKing closed 3 years ago

KyleKing commented 4 years ago

Hi! I am implementing implements in a personal project and found that it was easier to collect all the errors at once. Not sure if you would be interested in adding this feature, but figured I would submit a PR

If interested, I would be happy to make any changes or code cleanup

ksindi commented 4 years ago

Interesting idea. Thanks @KyleKing!

pshirali commented 4 years ago

@KyleKing this is a nice enhancement. Thank you for the contribution!

May I request a couple of things?

  1. I have recommended a small change to the error message. I'll leave it to your discretion to implement it.
  2. Could you please add one unittest which verifies that multiple errors are clubbed into a single error-msg. This may involve string matching, so you may choose to match just the minimum amount of string content; enough to verify that two or more errors are captured by the error msg. In case you agree to include my change, you could also verify against the count --- {x} in "Found {x} ..."

Thanks ! 👍

KyleKing commented 4 years ago

Thanks for the positive feedback! I think I implemented both changes you requested

pshirali commented 3 years ago

@KyleKing thank you so much! .. Approved 👍 .. Sorry for the delay in reviewing your changes. @ksindi please feel free to merge.