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?
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.
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?
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.