Skip to content

bpo-11063: Create _uuid1 submodule #3795

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

Closed
wants to merge 3 commits into from
Closed

bpo-11063: Create _uuid1 submodule #3795

wants to merge 3 commits into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 28, 2017

uuid module: move getnode() and uuid1() implementations to a new
_uuid1 submodule which is now loaded on demand to reduce side effects
on "import uuid".

https://bugs.python.org/issue11063

uuid module: move getnode() and uuid1() implementations to a new
_uuid1 submodule which is now loaded on demand to reduce side effects
on "import uuid".
@vstinner
Copy link
Member Author

_unixdll_getnode() and _windll_getnode() functions used UUID(bytes=bytes).node to convert bytes to a UUID object, then to get the node. I added a new "def _bytes_to_node(rawbytes):" helper function to break the dependency from _uuid1 to the uuid.UUID class. IMHO _bytes_to_node() is simple enough to justify the "duplication" of the code.

@gronke
Copy link
Contributor

gronke commented Sep 28, 2017

@Haypo have you noticed #3684 ? You're addressing a similar problem and your comment's are welcome! Personally I don't see a benefit from breaking uuid in two separate files. Instead we could move all code paths involved in uuid1() together. I'll comment on the other PR why we didn't.

@vstinner
Copy link
Member Author

Abandonned in favor of @pitrou's PR #3796.

@vstinner vstinner closed this Sep 28, 2017
@vstinner vstinner deleted the uuid1 branch September 28, 2017 13:47
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.

5 participants