Thank you for explaining Ben. I seem to have assumed a much simpler request and assuming your interpretation is correct, this is a much deeper issue.
I apologize for the length of some of my points as I grapple with interesting ideas.
I have done lots of programming in another interpreted language called R and have noted many differences in the approach that language chose versus Python. In R, for comparison, just about everything is deferred by default. It is a very different mindset that can both be very useful and also produce some rather bizarre results.
As an example, if I write a function in R, the arguments to the function are generally not evaluated before calling the function. But, as soon as the code in the body of the function uses a variable, with exceptions, it gets evaluated quietly. But you can easily write code near the top of the function that can gently evaluate arguments without triggering an evaluation and store such information for later use, including after it has been evaluated. As an example, if I do a regression with a formula, or give commands to generate a graph, the actual text I typed is captured and can be included in the output. Many Python equivalents I have seen will need a workaround where an additional argument in text has to be supplied that may be the same as another argument, so it can thus be used.
But as Python was not built with the same philosophy, adding related functionality now might not be trivial, or perhaps not very wanted.
Other languages sometimes have special functions that mark things in a way that says they should not be interpreted, at least at the time. Things like quote(…) or I(…) may be used. In theory, Python could adopt many methods and I have not studied it but suspect some are already available.
Obviously a trivial, but perhaps dangerous, method is to provide some code as text or some symbolic notation or perhaps embedded in some object with a protocol that every time the object is evaluated, it decrements an internal counter and returns a diminished copy of itself until the counter hits zero and the next reference does something or causes an eval of something.
Clearly, at the language level, one method would be along the lines of what the OP proposed. If a bracket was truly special and not currently part of normal Python code, it could theoretically behave in some new way when the interpret came along.
Consider something like:
【… 】
or
〘 … 〙
But once you open that door, it may get a bit too interesting.
Part of what misled me was the proposed method called a function with no argument and that is not really a very interesting case and often not something expected to do much processing. Had the example been more like:
queries = <"abc", expensive_func(arg1, arg2), "something else">
Then I might have seen the obvious as that would be far from trivial for other current methods to imitate. Presumably you want everything not evaluated yet including function arguments.
But any changes would need serious consideration to shoehorn into an existing language. What kind of environment will it be evaluated in compared to where it and parts of it have been defined? I have seen some rather convoluted code in R that plays with nested environments so a function makes changes in something like the parental environment or searches for variables in various environments. Do you need to implement closures holding some variables even when you are not sure which?
In my opinion, like any other language, python was built with a relatively few ideas in mind and started fairly simple if powerful, and then people keep improving it to the point where few people use some features and are often puzzled if they read code containing it. Obviously the people who decide what to add or change look carefully at potential consequences.
So, are there modules, such as those doing symbolic manipulations, that can help in a situation like the one being asked about?