Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DocumentValueError being raised byUUID constructor#144425

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Viicos wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromViicos:document-uuid-valueerror

Conversation

@Viicos
Copy link
Contributor

@ViicosViicos commentedFeb 3, 2026
edited by github-actionsbot
Loading

This is a trivial improvement that I think doesn't require an issue.


📚 Documentation preview 📚:https://cpython-previews--144425.org.readthedocs.build/

@@ -66,6 +66,7 @@ which relays any information about the UUID's safety, using this enumeration:
UUID(int=0x12345678123456781234567812345678)

Exactly one of *hex*, *bytes*, *bytes_le*, *fields*, or *int* must be given.
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

We could also explicitly specify that this raises aTypeError, but I feel like this is generally known that invalid arguments raiseTypeErrors?

Copy link
Member

Choose a reason for hiding this comment

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

Usually:

  • Invalid signature/usage/object types -> TypeError
  • Valid type but invalid data -> ValueError

The only exception I'm aware of isipaddress which raises TypeErrors a bit everywhere...

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Hum then not documentingValueError would maybe make sense? I had the correct assumption forTypeError, and wasn't sure for value errors but indeed it makes sense and once you know about this you can just write yourtry..except blocks from muscle memory

StanFromIreland reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

I am actually fine with documenting this. Sometimes we do document this, sometimes not.

Viicos reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@picnixzpicnixzpicnixz left review comments

Assignees

No one assigned

Labels

awaiting reviewdocsDocumentation in the Doc dirskip issueskip news

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Viicos@picnixz

[8]ページ先頭

©2009-2026 Movatter.jp