Skip to content

Remove unnecesarry branch for default empty list#3724

Closed
EdwardBlair wants to merge 1 commit intofastapi:masterfrom
EdwardBlair:patch-1
Closed

Remove unnecesarry branch for default empty list#3724
EdwardBlair wants to merge 1 commit intofastapi:masterfrom
EdwardBlair:patch-1

Conversation

@EdwardBlair
Copy link

list(dependencies or [])

is identical behaviour to

list(dependencies or []) or []

Is it not?

self.prefix = prefix
self.tags: List[str] = tags or []
self.dependencies = list(dependencies or []) or []
self.dependencies = list(dependencies or [])
Copy link
Contributor

Choose a reason for hiding this comment

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

self.dependencies = dependencies or [] this is good enough.

@EdwardBlair
Copy link
Author

EdwardBlair commented Jan 9, 2022 via email

@EdwardBlair
Copy link
Author

EdwardBlair commented Jan 9, 2022 via email

@tiangolo
Copy link
Member

Hey there! It seems this was handled recently in another PR, so I'm gonna close this one. But thanks for the effort! 🍰

@tiangolo tiangolo closed this Aug 26, 2022
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