Skip to content

Опечатка - Python: Именованные аргументы #332

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

Open
MaratSafiullinYabble opened this issue Mar 17, 2025 · 0 comments · May be fixed by #333
Open

Опечатка - Python: Именованные аргументы #332

MaratSafiullinYabble opened this issue Mar 17, 2025 · 0 comments · May be fixed by #333
Assignees

Comments

@MaratSafiullinYabble
Copy link

def print_params(a=1, b=2, c=None, d=4):
    print(a, b, c, d)

# Нужно передать только d, но приходится передавать все
f(1, 2, 3, 8)

# Именованные аргументы позволяют передавать только d
# Для остальных аргументов используются значения по умолчанию
f(d=8)

c=None

Скорее всего опечатка, это не согласуется с тем, что идет дальше по тексту

Логичнее:

def print_params(a=1, b=2, c=3, d=4):
    print(a, b, c, d)
@MaratSafiullinYabble MaratSafiullinYabble linked a pull request Mar 17, 2025 that will close this issue
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 a pull request may close this issue.

2 participants