Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/future/builtins/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/future/builtins/__pycache__/newsuper.cpython-311.pyc

�

�܋f	��r�dZddlmZddlZddlmZddlmZmZe	Z
e��Zeedfd�Z
d�Zd	�Zd
gZdS)ah
This module provides a newsuper() function in Python 2 that mimics the
behaviour of super() in Python 3. It is designed to be used as follows:

    from __future__ import division, absolute_import, print_function
    from future.builtins import super

And then, for example:

    class VerboseList(list):
        def append(self, item):
            print('Adding an item')
            super().append(item)        # new simpler super() function

Importing this module on Python 3 has no effect.

This is based on (i.e. almost identical to) Ryan Kelly's magicsuper
module here:

    https://github.com/rfk/magicsuper.git

Excerpts from Ryan's docstring:

  "Of course, you can still explicitly pass in the arguments if you want
  to do something strange.  Sometimes you really do want that, e.g. to
  skip over some classes in the method resolution order.

  "How does it work?  By inspecting the calling frame to determine the
  function object being executed and the object on which it's being
  called, and then walking the object's __mro__ chain to find out where
  that function was defined.  Yuck, but it seems to work..."
�)�absolute_importN)�FunctionType)�PY3�PY26�c��|tur�tj|��}	|j|jjd}n$#ttf$rtd���wxYw	t||j��}nn#tttf$rT	t|j|j��}n5#t$rtd���t$rtd���wxYwYnwxYw|turt||��St|��S)z�Like builtin super(), but capable of magic.

    This acts just like the builtin super() function, but if called
    without any arguments it attempts to infer them at runtime.
    rz'super() used in a function with no argsz$super() used with an old-style classzsuper() called outside a method)�	_SENTINEL�sys�	_getframe�f_locals�f_code�co_varnames�
IndexError�KeyError�RuntimeError�
find_owner�AttributeError�	TypeError�	__class__�_builtin_super)�typ�type_or_obj�
framedepth�fs    �i/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/future/builtins/newsuper.py�newsuperr-sN���i����M�*�%�%��	J��*�Q�X�%9�!�%<�=�K�K���H�&�	J�	J�	J��H�I�I�I�	J����		F��[�!�(�3�3�C�C����i�8�	F�	F�	F�
F� ��!6���A�A����!�
K�
K�
K�"�#I�J�J�J��
F�
F�
F�"�#D�E�E�E�
F������	F�����)�#�#��c�;�/�/�/��#���s3�=�!A�"A8�8C#�B+�*C#�+2C�C#�"C#c��|jD]�}|j���D]�}	t|t��sat|t
��r|j}n/	|j}n&#t$r|�	||��}YnwxYwt|t���an#ttf$rY��wxYw|j|ur|ccS����t�)z=Find the class that owns the currently-executing method.
    )�__mro__�__dict__�values�
isinstancer�property�fget�__func__r�__get__r�	func_code)�cls�coder�meths    rrrOs
���{�����L�'�'�)�)�	�	�D�

�$�T�,�7�7�
:�!�$��1�1�	:� $�y���:�#'�=�D�D��-�:�:�:�#'�<�<��S�#9�#9�D�D�D�:����%�T�,�7�7�
:���#�I�.�
�
�
���
�����~��%�%��
�
�
�
�
�&�#	�*�Os5�2B�A!� B�! B�B�B�B�B1�0B1c��tjd��}|jj}t	td���|��|i|��S)Nr�)r)r
rr
�co_name�getattrr)�args�kwdsr�nms    r�supermr1ksE���
�a���A�	
��	�B�-�7�8�q�)�)�)�"�-�-�t�<�t�<�<�<�r)�__doc__�
__future__rr
�typesr�future.utilsrr�superr�objectr	rrr1�__all__�r2r�<module>r;s�����B'�&�&�&�&�&�
�
�
�
�������"�"�"�"�"�"�"�"����F�H�H�	��	�a�����D���8=�=�=��,���r2

Hacked By AnonymousFox1.0, Coded By AnonymousFox