Closed ThorvaldAagaard closed 7 months ago
There is a suppress_unicode
context manager:
>>> from endplay.config import suppress_unicode
>>> with suppress_unicode():
... print(Denom.spades.abbr)
S
>>> print(Denom.spades.abbr)
♠
to make the switching feel a bit less hacky, I don't know if it is really worth adding a abbr_plain
property or something like that, but if you have a good use-case which other people might come across then it would be an easy addition to make :)
I would prefer to have a property, but realizing I always will avoid unicode I have just added
#Don't use unicode
config.use_unicode = False
at the beginning of my application.
The use case would be for applications creating .lin files as unicode is not supported in .lin
So fell free to close this issue if the work around is acceptable.
In some situations I would like to print the contract as:
2♠E+1
but in other situations I would like to print it as
2SE+1
In Denom, there is this implementation
I think it would be better to have 2 different properties, instead of letting the property use the configuration.
In the current implementation I will have to change the config before and after the call.