Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'd imagine that there would be some way to do it. But I feel compelled to ask, is there really a big enough difference in readability from this</p> <pre><code>Allocation(Param1 = Val1, Param2 = Val2 ) </code></pre> <p>To this:</p> <pre><code>Allocation(Param 1 = Val1, Param 2 = Val2 ) </code></pre> <p>to make that big a difference? I'm sure there's a way to do what you want to do, but my first concern is if the effort involved would be worth the result.</p> <blockquote> <p>my goal is to provide a DSL which can be used for data entry into the system. In the above scenario, params would be people names and values would be percentages.</p> </blockquote> <p>I have a better understanding of what you want to do now, but I still think that you might end up having to sacrifice some readability to get what you want. Personally, I would go with something like:</p> <pre><code>Allocation( { 'name1' : value1, 'name1' : value2, } ) </code></pre> <p>If that's not something you can go with, then you might want to reconsider whether you want to use Python for your DSL or go with something home-grown. Allowing whitespace allows too many ambiguities for most programming languages to allow it.</p> <p>If you still want to pursue this with using python, you might want to consider posting to the C-API SIG (<a href="http://www.python.org/community/sigs/" rel="nofollow noreferrer">SIGS</a>) or maybe the <a href="http://mail.python.org/mailman/listinfo/python-dev" rel="nofollow noreferrer">python-dev list</a> (as a last resort). The only way that I can see to do this would be to embed the python interpreter into a C/C++ program and do some kind of hacking with it (which can be difficult!).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload