Skip to content

Conversation

@codingorijazz
Copy link
Contributor

함수의 인자에 미리 값을 정할 수 있습니다.

장점
매번 인자를 입력하지 않아도 되어 편리합니다.
함수를 여러 개 만들지 않고 하나의 함수로 다양한 상황을 처리할 수 있습니다.
오버로딩 기능을 간단히 흉내 낼 수 있습니다.

단점과 주의점
기본값은 모듈 로드시 한 번만 설정됩니다.
리스트([])나 딕셔너리({}) 같은 가변 객체를 기본값으로 쓰면 안 됩니다.
값이 공유되어 문제가 생길 수 있습니다.

결론
기본값은 편리하지만, 가변 객체는 쓰지 마세요.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @codingorijazz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request adds a new section to the documentation about default argument values in Python. The changes include adding a new markdown file (default-argument-values.md) and linking it in the mkdocs.yml navigation file. The PR description provides a summary of the advantages, disadvantages, and important considerations when using default argument values, particularly cautioning against the use of mutable objects as default values.

Highlights

  • Documentation: Adds a new documentation page explaining default argument values in Python.
  • Navigation: Updates the mkdocs.yml file to include the new documentation page in the navigation menu.
  • Best Practices: Highlights the importance of avoiding mutable objects as default argument values to prevent unexpected behavior.

Changelog

  • mkdocs.yml
    • Added 'Default Argument Values' to the navigation menu under 'Python Style Rules'.
    • The new entry points to the default-argument-values.md file.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Did you know?

Python was named after the British comedy group Monty Python. Guido van Rossum, the creator of Python, was a big fan of their work.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request adds a new page about default argument values to the Google Python Style Guide translation. The changes involve adding an entry to the navigation in mkdocs.yml. The translation of the style guide is a valuable contribution. However, the new content file itself (google python style guide/default-argument-values.md) is empty, which needs to be addressed.

Summary of Findings

  • Missing Content in New Page: The file google python style guide/default-argument-values.md is currently empty. This file should contain the translated content regarding default argument values as described in the pull request title and description.

Merge Readiness

The pull request cannot be merged in its current state because the content file for the new page is empty. The author needs to add the translated content to google python style guide/default-argument-values.md before this pull request can be considered for merging. I am unable to directly approve the pull request, and other reviewers should also verify the content before approval.

@GideokKim
Copy link
Owner

@codingorijazz 마크다운 파일에 번역 내용이 안들어가 있어요!

Copy link
Owner

@GideokKim GideokKim left a comment

Choose a reason for hiding this comment

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

LGTM

@GideokKim GideokKim merged commit 0a2bae2 into GideokKim:main May 6, 2025
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.

2 participants