Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: Decorate asserts with helpful messages #3024

Closed
ghost opened this issue Mar 12, 2013 · 7 comments
Closed

TODO: Decorate asserts with helpful messages #3024

ghost opened this issue Mar 12, 2013 · 7 comments

Comments

@ghost
Copy link

ghost commented Mar 12, 2013

See changes made in #3023, #2057.

Enhancing an assert with a meaningful message
is an easy way to make your first contribution to the
pandas project.

@cpcloud
Copy link
Member

cpcloud commented May 1, 2013

Would a script to find such things be helpful? I think I can cook one up using ast or some such other magik.

@ghost
Copy link
Author

ghost commented May 1, 2013

if you'd like to make one, sure. we'll open another #2916 for it.
but the intent was not just re asserts lacking a message, but also those lacking a good message.

@cpcloud
Copy link
Member

cpcloud commented May 1, 2013

ah ok. no script for that :).

@cpcloud
Copy link
Member

cpcloud commented May 2, 2013

python -O is weird. Whoa, @y-p did you do all of those conversions by hand? This could probably be generalized to "Decorate explicitly raised exceptions with helpful messages". Also, getting rid of all of the generic Exception calls is probably a good idea IMHO.

@cpcloud
Copy link
Member

cpcloud commented May 3, 2013

Getting rid of all the generic Exception calls is probably a long term goal, since there's probably all kinds of catching these guys throughout the codebase. To the ast module, batman!

@ghost
Copy link
Author

ghost commented May 3, 2013

yea manually, with the aid of an editor macro. it's a one time thing not worth automating beyond.

as for catching Exception, I agree it's often a bad idea, and has caused some corner cases,
especially in deep call stack where unintended consequences can rise. can't be helped though,
sometimes. especially when you're speculatively relying on user provided lambdas and want to recover
gracefully.

@ghost
Copy link
Author

ghost commented Jan 10, 2014

Eternal, but largely addressed by #3770.

@ghost ghost closed this as completed Jan 10, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant