3 ms·
Is there any chance you are considering moving towards structured data as HTML, as in SXML, instead of putting things into fstrings?
by zelphirkalt 3y ago
Is there any chance you are considering moving towards structured data as HTML, as in SXML, instead of putting things into fstrings?
- paveldedik 3y agoWell, I would like it if the solution supported standard Python typing. Here I can create a "component" that expects a specific type of the first child and a specific type of the second child. I would probably have to use a separate tool for some kind of type-checking the SXML or something. BTW in Rust, you can create macros, that is something I like a lot as you can see in yew framework - https://yew.rs/docs/getting-started/build-a-sample-app#update-mainrs https://yew.rs/docs/getting-started/build-a-sample-app#updat... - you can write HTML which probably are typed. Python doesn't have anything like that, I don't know about any other way to do this. // edit typo
- zelphirkalt 3y agoWhether compile time guarantees or not, even having HTML elements as objects would be better than putting them into the f-strings. With objects we could probably pattern match on then and traverse the tree, instead of having to rely on other tooling or even regex to search for things inside an f-string.