This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
multipub/.pyenv/lib/python3.7/site-packages/astroid/brain/brain_uuid.py

21 lines
564 B
Python
Raw Normal View History

2019-02-09 02:45:25 -06:00
# Copyright (c) 2017 Claudiu Popa <pcmanticore@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
"""Astroid hooks for the UUID module."""
from astroid import MANAGER
from astroid import nodes
def _patch_uuid_class(node):
# The .int member is patched using __dict__
node.locals["int"] = [nodes.Const(0, parent=node)]
MANAGER.register_transform(
nodes.ClassDef, _patch_uuid_class, lambda node: node.qname() == "uuid.UUID"
)