-
Notifications
You must be signed in to change notification settings - Fork 4
PEP498 Standard: Type Conversion #10
Copy link
Copy link
Open
Labels
Milestone
Description
Following each expression, an optional type conversion may be specified. The allowed conversions are '!s', '!r', or '!a'. These are treated the same as in str.format(): '!s' calls str() on the expression, '!r' calls repr() on the expression, and '!a' calls ascii() on the expression. These conversions are applied before the call to format(). The only reason to use '!s' is if you want to specify a format specifier that applies to str, not to the type of the expression.
Reactions are currently unavailable