-
Notifications
You must be signed in to change notification settings - Fork 0
Quirks
Some quirks of the coding style
I use this module to change my path because of the way source is laid out on my machines. It normally will have no effect on you. Feel free to empty the file or make any other change on your own machine if you do not like its repo contents.
At the top of most files. In development running of most file will result in the whole app being run by means of main.py This means you do not have to navigate to main.py to run.
I find it more readable, may or may not blacken in future.
-- I need to explain....
Often used when not necessary because makes extension of string to multi-line string easy.
as in
msg = ( "some message" ) print( msg )
Why:
- can assist in debug
- helps keep lines short
- may be more readable
- if local is used multiple times actually speeds code ( does no slow down )
- typos are caught in locals but not instance var.
- often used: msg, widget, sql, db,
Why:
May be used to prevent name collisions: a_str not str for a variable
I normally use ix for the numerical index in a loop. If looping over a list of names, I might use "i_name in names" with enumerate both of them.
This creates an outline heading in Spyder. It is great for code navigation. # ---- tof for top of file # ---- eof for end of file.
This seems to come, in part, with QT programming, but these long modules often come with multiple classes that are all loaded at the same time Separate classes gives name space isolation. The outline comments in Spyder make navigation easy. I have not yet found a reason to break them up.
Use to keep code style tools quite and used when I think the method name, arguments, and code are self explanatory enough.
Have not seen the cost benefit being favorable. My try letting simulated intelligence take a try at it. If the cost were low enough I would do it.
I just have not figured out how to do it especially since so many things happen primarily in the GUI.
- !! marks code that "must" be revisited.
- ?? marks questions to think about when we have time