Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python list should be the last selection among the options and usage of python data types #40

Closed
azamifard opened this issue Sep 28, 2020 · 1 comment
Assignees

Comments

@azamifard
Copy link
Contributor

azamifard commented Sep 28, 2020

@aperrin66
@akorosov
Although you know it better than me about the data types in python. I need to describe what is in my mind when I create this issue.
Python lists are only needed when we want to save the order of elements inside it. When we don't need order, there is no need to use a python list!!!!

Sets should be used for the case that we add another element in it afterwards.
tuple should be used for the case that we do not need to change it afterwards.

For the speed of running the code the order of selection data types is as follows:

  1. tuple
  2. set
    3.list
@azamifard azamifard changed the title lists are slower than tuples in python. No need to use them in creating the crawlers and ingesters .... Sep 28, 2020
@azamifard azamifard reopened this Sep 29, 2020
@azamifard azamifard changed the title .... python list should be the last selection among the options and usage of python data types Sep 29, 2020
azamifard pushed a commit that referenced this issue Sep 29, 2020
@azamifard azamifard self-assigned this Sep 29, 2020
@akorosov
Copy link
Member

akorosov commented Oct 2, 2020

Increment in speed is negligible compared to our effort spent on replacing square brackets with curly brackets. Besides in some cases we have to use tuples and in some - sets.
No, let's consistently use lists. And only when we cannot use lists we should use something else.

@akorosov akorosov closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants