hupili / python-for-data-and-media-communication-gitbook

An open source book on Python tailed for communication students with zero background
118 stars 62 forks source link

Avoid using reserved word in variable names #107

Closed hupili closed 6 years ago

hupili commented 6 years ago

FAQ: https://github.com/hupili/python-for-data-and-media-communication-gitbook/blob/master/python-language-basics.md#name-clash-with-reserved-word

ChicoXYC commented 6 years ago

@hupili update --> b84b9ae scan the whole document, replacing conflict word in variable names. Including str, dict, list.

hupili commented 6 years ago

list1 is not good. That let's people think list could be a valid name. Please use mylist if you can not find a proper name.

If there is a physical meaning, we usually embed the physical meaning in the variable name. For example, if you have a list of articles, either say articles = [] or article_list = [].

ChicoXYC commented 6 years ago

update ea3c183