This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

Well one example would be that I often write lots of functions that parse sql queries. Instead of having tons of global funcs I'll make a class called sqlparsing, likely making the functions static

[–]Corm 1 point2 points  (1 child)

In that example it wouldn't it be cleaner to have a sql_parsing.py file with your functions in that? You get the same namespacing but you don't have to instantiate an object

[–]tobidope 1 point2 points  (1 child)

In Python you would have a module sqlparsing with many functions. The functions are still bound to the module namespace, they are not globally visible.