[Tutor] Problem with if statements and else statements
Alex Kleider
akleider at sonic.net
Mon May 29 19:44:32 EDT 2017
On 2017-05-29 16:08, Cameron Simpson wrote:
snip
> BTW, in Python we tend to use named like "Fred" for classes (or
> factories), and "fred" for regular variables. And "FRED" for things
> that would be constants in other languages. Eg:
>
> MAX_THINGS = 16
>
> class Foo:
> ....
>
> def FooBah(x):
> return Foo(x, style="bah")
Yes, I've been aware of these conventions except for the last- I haven't
knowingly used 'factories.' I assume from the context that factories
return class instances so it makes sense to use the same conventions
that apply to class names.
...and thanks again for explaining.
Alex
More information about the Tutor
mailing list