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

More style changes for pylint #590

Merged
merged 26 commits into from
Aug 16, 2019
Merged

More style changes for pylint #590

merged 26 commits into from
Aug 16, 2019

Conversation

talavis
Copy link
Contributor

@talavis talavis commented Aug 15, 2019

Describe the pull request:

  • Bug fix
  • Functional change
  • New feature
  • Code cleanup
  • Build system change
  • Documentation change
  • Language translation

Pull request long description:

More style changes for pylint. Pylint will now be used for backend by travis.

@talavis talavis marked this pull request as ready for review August 15, 2019 07:16
(r"/api/dataset/(?P<dataset>[^/]+)/(?:version/(?P<ds_version>[^/]+)/)?browser/search/(?P<query>[^/]+)", handlers.Search),
(r"/api/dataset/(?P<dataset>[^/]+)/(?:version/(?P<ds_version>[^/]+)/)?browser/download/(?P<datatype>[^/]+)/(?P<item>[^/]+)(?:/filter/(?P<filter_type>[^/]+))?", handlers.Download),
]
routes = [(r"/api/dataset/(?P<dataset>[^/]+)/(?:version/(?P<ds_version>[^/]+)/)?browser/gene/(?P<gene>[^/]+)", handlers.GetGene),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, I do think the removed whitespaces make the code less readable.

with db.database.atomic():
for i, feature in enumerate(self.features):
i = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's wrong with enumerate? Isn't it nice not to have to update i explicitly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that i is used once outside the loop (directly after). Defining i outside the loop is the only way to guarantee that the value is not garbage collected before it's used there.

Copy link
Contributor Author

@talavis talavis Aug 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though that specific i=0 is not needed.

@talavis talavis merged commit 8e5a3f8 into develop Aug 16, 2019
@talavis talavis deleted the pylinting branch August 19, 2019 10:30
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

Successfully merging this pull request may close these issues.

None yet

2 participants