Python Forum
i would like this kind of logic - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: i would like this kind of logic (/thread-38519.html)



i would like this kind of logic - Skaperen - Oct-25-2022

back in my assembly language days i could put together some logic where i had 2 conditionals (lets call them A and B) and 2 bodies of code (C and D). if A is true i want to do C and D. if B is true i want to do only D. but i need to have C and D together because C changes the way D works. i'm guessing the basic way to do this in a high level language is the infamous goto if the language supports that. i have heard that some languages support odd language structures that someone thought was needed. i'm wondering if Python supports any. i remember it does the loop/else logic, which can sometimes be handy. anything else?

i did develop assembly language tools (macros) that created programming structures for conditionals and loops with nesting up to 99 levels (never tested). of course it did not enforce indentation. i did have a very fast AVL tree implementation that beat the hash table from IBM. i tried to use the hash table as a tree-cache but it actually slowed it down. took out the cache and it zoomed. that was back in the day when speed of code mattered. today, not so much, if at all (unless you are programming an antique).