<div dir="ltr">I would like to be able to use named sections to organise my code, much an inline submodules, bit without using classes or functions to organise them. I would use this if I had a group of related functions which were not written in an object-oriented-style, possibly due to not needing any shared state. Rather than break these out into a new file, I would like to just be able to use internal structure to declare the relationship. I've used the keyword 'block' to indicate the start of a named block.<div><br></div><div>For example, </div><div><br></div><div>block signin:</div><div>     def handle_new_user():</div><div>           do_it()</div><div><br></div><div>     def handle_existing_user():</div><div>           do_it()</div><div><br></div><div><br></div><div>while True:</div><div>    try:</div><div>        signin.handle_existing_user():</div><div>    except:</div><div>        signin.handle_new_user()</div><div><br></div><div>    do_other_stuff()</div><div><br></div><div>At the moment, I would have to either break out into more files, or somewhat clumsily co-opt things like functions or staticmethods. I think that supporting named blocks or inline module declarations would really help me organise some of my code much better. It could also provide a more seamless way to decide to break out into a new file. Once a named block got big enough, I could easily create a new file and import those functions into the same namespace.</div><div><br></div><div>I hope this makes sense and that I'm not overlooking anything obvious.</div><div><br></div><div>Cheers,</div><div>-Tennessee</div></div>