HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/future/builtins/__pycache__/newsuper.cpython-310.pyc
o

,�]2�@s`dZddlmZddlZddlmZddlmZmZe	Z
e�Zeedfdd�Z
d	d
�ZdgZdS)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�cCsF|tur�t�|�}z|j|jjd}Wn
ttfy!td��wz|j	}Wnt
tfyDz|jj	}Wnt
yAtd��wYnw|D]J}|j�
�D]@}z*t|t�syt|t�r_|j}nz|j}Wnt
ys|�||�}Ynwt|t�rVWnt
tfy�YqNw|j|jur�nqNqGntd��|tur�t||�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 a non-newstyle classzsuper() called outside a method)�	_SENTINEL�sys�	_getframe�f_locals�f_code�co_varnames�
IndexError�KeyError�RuntimeError�__mro__�AttributeError�	__class__�__dict__�values�
isinstancer�property�fget�__func__�__get__�	TypeError�	func_code�_builtin_super)�typ�type_or_obj�
framedepth�f�mro�meth�r#�:/usr/lib/python3/dist-packages/future/builtins/newsuper.py�newsuper-sT
�
���



�
����
r%cOs,t�d�}|jj}ttdd�|�|i|��S)Nr�)r)rr	r�co_name�getattrr%)�args�kwdsr �nmr#r#r$�supermls
r,)�__doc__�
__future__rr�typesr�future.utilsrr�superr�objectrr%r,�__all__r#r#r#r$�<module>s!?