Menu

#42 reverse node mapping

2.0
open
nobody
None
2024-09-15
2024-09-15
No

Recently, in http://hg.code.sf.net/p/generateds/code/rev/c6b3fd10cce2 (2.39.4) and http://hg.code.sf.net/p/generateds/code/rev/07e5779335a2 (2.39.7), an actual reverse mapping enabling round-trip lookups has been introduced. That's fantastic, thanks!

IMO this should be made more prominent in the tutorial, esp. the example code in https://www.davekuhlman.org/generateDS.html#toc-entry-65 and explanation in https://www.davekuhlman.org/generateDS.html#toc-entry-66 (Mapping generateDS objects to Lxml Elements and back).

Also, I find it quite inconvenient that it is still necessary to pass in reverse_mapping as an empty dict. Couldn't you just use the existing last element of the returned tuple, reverse_node_mapping, which currently still derives from the old method GeneratedsSuper.gds_reverse_node_mapping? Perhaps this needs to be a new CLI option, though.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.