Closed Notmarrco closed 6 years ago
Thanks!!
I’m not sure, though, that we want to be in the business of supporting strings. It seems a little unpythonic to allow any type that can be converted to a float with int(float(...))
. Can we just check whether isinstance(..., (int, float))
or similar and just raise a TypeError otherwise?
Yes you're right.
Or I could just do like in line 223 https://github.com/beetbox/pyacoustid/blob/master/acoustid.py#L223 and cast to int()
.
Not as polished as your suggestion, but at least it's consistent with the codebase.
Sure; just having an int(...)
wrapping that will work great.
Awesome; thank you! :sparkles:
Fix #38
we could also use
math.floor
orround
depending on what's the best for acoustid ... Tell me if one of them is better.The
float
call is made to handle the case when duration is a string or else.