1# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
2# For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE
3# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt
4
5"""Astroid hooks for the UUID module."""
6from astroid.manager import AstroidManager
7from astroid.nodes.node_classes import Const
8from astroid.nodes.scoped_nodes import ClassDef
9
10
11def _patch_uuid_class(node: ClassDef) -> None:
12 # The .int member is patched using __dict__
13 node.locals["int"] = [Const(0, parent=node)]
14
15
16def register(manager: AstroidManager) -> None:
17 manager.register_transform(
18 ClassDef, _patch_uuid_class, lambda node: node.qname() == "uuid.UUID"
19 )