This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ariebovenberg
Recipients ariebovenberg, docs@python, eric.smith, erlendaasland, vinay.sajip
Date 2022-01-02.16:58:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641142681.95.0.761280913923.issue46200@roundup.psfhosted.org>
In-reply-to
Content
Indeed the `__format__` style offers a lot more options (see https://pyformat.info/).

Regarding performance you make an interesting point.

One possible solution is to allow f-strings _only_ if there are no args/kwargs.
In that one case formatting would explicitly be skipped. 
This could be represented at type-level with an overload:

    # case: Logger does formatting. Only literal string template allowed.
    @overload
    def debugf(msg: Literal[str], *args, exc_info: bool = False, **kwargs):
        # wrap

    # case: User does formatting. No args/kwargs allowed.
    @overload
    def debugf(msg: str, *, exc_info: bool = False):
        # wrap `msg` in something that will not allow further formatting.
History
Date User Action Args
2022-01-02 16:58:02ariebovenbergsetrecipients: + ariebovenberg, vinay.sajip, eric.smith, docs@python, erlendaasland
2022-01-02 16:58:01ariebovenbergsetmessageid: <1641142681.95.0.761280913923.issue46200@roundup.psfhosted.org>
2022-01-02 16:58:01ariebovenberglinkissue46200 messages
2022-01-02 16:58:01ariebovenbergcreate