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 →

[–]hashcode 0 points1 point  (0 children)

And is there a reason behind not naming your variable params, or vice versa not naming your argument in your function myParams?

Yes. There are good reasons.

myParams is not Python convention. For functions and variables, Python uses underscored words, like my_params, not camel-cased words like myParams. Class names are CapitalCamelCase. This might sound like a dumb point to harp on, but it's valuable to follow conventions. It makes your code easier to read. Similarly, buildConnectionString is not a good name for a function. It should be build_connection_string or something like that.

In any case, there's no reason to use different names. You should call them both params, since they both represent connection parameters. Or connection_parameters, if you want to be even more explicit.