On Tue, Dec 20, 2022 at 11:17 PM Stephen J. Turnbull <
stephenjturnb...@gmail.com> wrote:

> Ricky Teachey writes:
>
>  > This isn't to say it should definitely be added to the language, that's
> a
>  > tough hurdle. But boy would I have used it.
>
> IIUC, Mathew's idea doesn't need to be added to *the* language (the
> one defined by the Language Reference).  It needs to be added to the
> languages used by type checkers.
>
> So if you want this and know a type checker author, send them pizza! :-)
>
> Steve
>

Unfortunately subclassing LiteralString is a TypeError at this time. Otoh
something like this doesn't necessarily have to be a LiteralString child
class, but it does mean someone who is a little more knowledgeable than I
would have to write such a CustomString parent class, or custom_str()
factory.

Anyway I guess probably this is a discussion for the typing mailing list.
Maybe the OP should consider taking it there?

---
Ricky.

"I've never met a Kentucky man who wasn't either thinking about going home
or actually going home." - Happy Chandler
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/FMVFUFBA2DWZRRYMN6SNIJSSENDWXLL7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to