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

Small fixes after pylint/flake cleanup #218

Merged
merged 1 commit into from
Sep 18, 2019
Merged

Small fixes after pylint/flake cleanup #218

merged 1 commit into from
Sep 18, 2019

Conversation

dagwieers
Copy link
Contributor

@dagwieers dagwieers commented Sep 18, 2019

Check if this PR fulfills these requirements:

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Feature change (non-breaking change which change behaviour of an existing functionality)
  • Improvement (non-breaking change which improve functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

After reviewing #194 after an issue (#217) was found, I found one other issue.
Which this PR fixes.

Copy link

@Smeulf Smeulf left a comment

Choose a reason for hiding this comment

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

Both are technically correct right? I mean the result will be the same(?)

Plus it seems to me that your code will test for videoId.mediatype value once more than the previous code (I am wrong?)

I don't understand why you fight 'elif', I'd be glad if you can explain deeper so I can learn.

@Smeulf
Copy link

Smeulf commented Sep 18, 2019

Got it!

In the former code, we were doing an action for mediatype=MOVIE or for mediatype=SHOW.
In your code before the fix, if the type is MOVIE, the code will jump to for season_key in item.keys(): and run into an error.

So this fix is very right.

@dagwieers
Copy link
Contributor Author

As most of the source code, annotations would be helpful 😉

@Smeulf
Copy link

Smeulf commented Sep 18, 2019

I agree, and have to admit that piece of code I wrote was not a model of art...

@dagwieers
Copy link
Contributor Author

@Smeulf There is no real issue with the code, but I learned earlier this year something called return early or guard code and it is something I unknowingly was practising already to keep indentation to a minimum (and readability to a maximum).

It is very pythonic and well-explained here: https://openfolder.sh/returning-early

@Smeulf
Copy link

Smeulf commented Sep 18, 2019

And by extension, it reduces the code complexity if I'm correct.

@CastagnaIT CastagnaIT merged commit 4c7706b into CastagnaIT:master Sep 18, 2019
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.

3 participants