Conversation
mamo3gr
reviewed
Jan 15, 2026
Comment on lines
+29
to
+30
| - `あくまで個人的な感覚ですが、 try except は重そうという印象があります。実際にどの程度重いかは実装してみないと何とも言えません。個人的には、エラーコード等で代替するなど、現実的なコストで避けられるのであれば避けたいです。この辺りは所属するチームの平均的な書き方に合わせることをお勧めいたします。` | ||
| - try-exceptは重そうという感覚を持っておく |
There was a problem hiding this comment.
Pythonの場合、例外が発生しなければオーバーヘッドはほぼ無し、発生したらスタックトレースを収集するので結構遅くなるそうです。
mamo3gr
reviewed
Jan 15, 2026
Comment on lines
+15
to
+16
| if len(split_result) != 2: | ||
| raise ValueError('Email must have one "@".') |
There was a problem hiding this comment.
入力データにひとつでも仕様外のものがあると、全体の処理が止まってしまいます。これが実務上いいかどうかの考察があると良いでしょう。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
この問題:https://leetcode.com/problems/unique-email-addresses/description/
次に解く問題:https://leetcode.com/problems/first-unique-character-in-a-string/description/