-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Why does Barcode.build()
always return a singleton list?
#228
Comments
This is almost always the answer for anything unclear in this codebase. It is a fork of an older, unmaintained, library from over a decade ago, and it's been hard to clean up these quirks without breaking backwards compatible. At this point, I'm okay with making breaking API changes as long as they're clear and well documented. New versions follow semver to indicate breaking changes.
True, I've confirmed that they all return a list with a single string. We can definitely change this to simply return a string instead. |
Thanks a lot for the clear explanation. I feel for you on the quirky legacy codebase. All that callback nonsense is totally out of control. It'd be great to eventually have a clean functional interface, but I can see that it's a ton of work. |
The return type of
Barcode.build()
isList[str]
. But in all overrides of.build()
, the return value is always a singleton. I'm trying to understand the source code, and I find this really confusing, so I was wondering if there's an explanation. Is it for historical / backwards compatibility reasons?I would have expected the return type to be
str
, so then I want to understand what lists of different lengths are supposed to mean. Maybe it would be good to at least include an explanatory comment to reduce confusion? Thanks!The text was updated successfully, but these errors were encountered: