Hacker News new | past | comments | ask | show | jobs | submit login

Actually the proper way to handle is to use protocols. They provide already SupportsBytes type, and you can similarly create custom SupportsStr, but IMO it is silly to do that. This approach increases chance of bugs, and it's just easy to use str type and for developer to wrap such value in str(). I believe that's why SupportsStr was not introduced.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: