Creating user defined literals representing a data type

Question:

There are literal that represent a built-in data type

Examples

"" represents a string

{} represents a dictionary

How can I make user-defined literals to represent a object of the type I want?

Asked By: Supergamer

||

Answers:

You can’t do that in python

Or most other languages. You would have to change the python parser and the source code. So this is sadly not possible.

Answered By: thatrandomperson
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.