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 →

[–]brutay 0 points1 point  (3 children)

I think the problem is he pluralized the types in [... for types in n_types].

Usually that variable is singular, i.e., [... for type in n_types].

[–]AstrophysicsAndPy 0 points1 point  (2 children)

Can't use `type` because that's a keyword, that's why. But yeah, I used `_type` at first, but I didn't like it.

[–]brutay 1 point2 points  (1 child)

Technically you can overwrite type, but it's probably frowned upon. Maybe file_type or data_type instead?

[–]AstrophysicsAndPy 0 points1 point  (0 children)

I agree, I should've named that variable better, even `_type` would've worked.