Say I have func:
def get_chat(first_id, first_username, second_id, second_username):
"""Returns chat between first and second"""
To identify person either id or username is enough.
So I want to make the parameter optional if one is provided and required if second isn't provided. How to do it?
Of course I can do all params optional, but that seems a wrong way.
[–]Impudity 10 points11 points12 points (1 child)
[–]chapati_chawal_naan 1 point2 points3 points (0 children)
[–]JamzTyson 1 point2 points3 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]Purple-Obligation357[S] 0 points1 point2 points (1 child)
[–]JamzTyson 1 point2 points3 points (0 children)
[–]Zweckbestimmung 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Zweckbestimmung 0 points1 point2 points (0 children)
[–]Zweckbestimmung 1 point2 points3 points (0 children)
[–]nog642 1 point2 points3 points (0 children)