You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the string checking is ultimately trying obj + '' to see if it's "string like". That looks a bit JavaScript-y, so maybe tweak that? str(obj) is tautological as it falls back to repr() which always works, so I don't know how to check if str() gives something "reasonable looking".
Maybe just don't check at all as @tacaswell suggests.
I think for checking stringy-ness seeing if you can add a string is about as good as you are going to get. I put in a PR to relax the validation (along with some maintenance and doc changes).
Activity
efiring commentedon Dec 1, 2014
Logically, shouldn't a label always be a string?
mwaskom commentedon Dec 1, 2014
No, it is logically possible for labels to be numbers.
jenshnielsen commentedon Dec 1, 2014
Why would you prefer a number over str(number)?
mwaskom commentedon Dec 1, 2014
An idiosyncratic preference for generality and brevity.
tacaswell commentedon Dec 1, 2014
The block of code that is raising the error is doing excessive type checking anyway.
I would argue that a label should be anything that can be coerced to be a string.
nicktimko commentedon Dec 28, 2014
It looks like the string checking is ultimately
tryingobj + ''to see if it's "string like". That looks a bit JavaScript-y, so maybe tweak that?str(obj)is tautological as it falls back torepr()which always works, so I don't know how to check ifstr()gives something "reasonable looking".Maybe just don't check at all as @tacaswell suggests.
BUG : relax validation on hist label
tacaswell commentedon Dec 28, 2014
I think for checking stringy-ness seeing if you can add a string is about as good as you are going to get. I put in a PR to relax the validation (along with some maintenance and doc changes).
mwaskom commentedon Oct 19, 2018
Looks like didn't actually address this issue (cf mwaskom/seaborn#1593).
Specifically:
jklymak commentedon Oct 19, 2018
Re-opening, though this new report is slightly different...