Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

brain_uuid.py 572B

12345678910111213141516171819202122
  1. # Copyright (c) 2017 Claudiu Popa <pcmanticore@gmail.com>
  2. # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
  3. # For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
  4. """Astroid hooks for the UUID module."""
  5. from astroid import MANAGER
  6. from astroid import nodes
  7. def _patch_uuid_class(node):
  8. # The .int member is patched using __dict__
  9. node.locals['int'] = [nodes.Const(0, parent=node)]
  10. MANAGER.register_transform(
  11. nodes.ClassDef,
  12. _patch_uuid_class,
  13. lambda node: node.qname() == 'uuid.UUID'
  14. )