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

support string formatter's width specification #37

Open
keturn opened this issue Dec 15, 2019 · 0 comments
Open

support string formatter's width specification #37

keturn opened this issue Dec 15, 2019 · 0 comments

Comments

@keturn
Copy link
Contributor

keturn commented Dec 15, 2019

Consider

print(f"A{cf.italic_underlined_lavender('Z'):>80}")

The Z ends up in quite a different spot when color output is enabled vs disabled!

I believe that since ColorfulString already knows how to calculate its printable length, it would be able to appropriately handle field width specifications if it were to implement __format__.

That method is used by both the f-string literals and format().

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