Replies: 2 comments 2 replies
-
|
I'd argue that in these examples To make certain the htpy variation of this reads with the right precedence rules, I'd like the replacement for One alternative is to use double underscore:
|
Beta Was this translation helpful? Give feedback.
-
|
With an afterthought, I think we could reuse my initial proposal to have Uppercase letter to emulate the dot
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
As a lot of my fellow pythonistas, I've been playing a lot lately with frontend frameworks that play well with server side rendering, namely
htmxandalpinejs. And like most of other frontend frameworks, those rely on adding somehtmlelement attributes that are not standard and contain non alpha characters. Luckilyhtpyhandles this just fine with the help ofdictattributes but my OCD is striking again as I hate to have one or two attributes styled differently from the others.From my experience, 90% of the time, you need to switch to
dictattributes to handle just 2 special characters : at sign@and colon sign:. Knowing that with most frontend frameworks that I know of (Alpine, HTMX, Vue), the@sign is syntactic sugar and can be replaced with another syntax involving the colon sign:, I would consider that handling the colon sign:alone would in fact avoid having to switch to thedictattribute syntax 90% of the time.Now my proposal is the following: allow element attributes to contain upper case chars and consider that an upper case char is in fact the lower case equivalent preceded by a colon sign
:.Here's what it would look like in the end:
@clickhx-on:clickhx_onClickhx-on:htmx:config-requesthx_onHtmxConfig_request@clickx-on:clickx_onClickv-bind:src:srcv_bindSrcorSrcHappy to discuss about this proposal that I think would be a great quality of life improvement for htpy.
Beta Was this translation helpful? Give feedback.
All reactions