HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.7/lib2to3/fixes/__pycache__/fix_idioms.cpython-37.pyc
B

5a@sNdZddlmZddlmZmZmZmZmZm	Z	dZ
dZGdddejZ
dS)	aAdjust some old Python 2 idioms to their modern counterparts.

* Change some type comparisons to isinstance() calls:
    type(x) == T -> isinstance(x, T)
    type(x) is T -> isinstance(x, T)
    type(x) != T -> not isinstance(x, T)
    type(x) is not T -> not isinstance(x, T)

* Change "while 1:" into "while True:".

* Change both

    v = list(EXPR)
    v.sort()
    foo(v)

and the more general

    v = EXPR
    v.sort()
    foo(v)

into

    v = sorted(EXPR)
    foo(v)
)
fixer_base)CallCommaNameNode	BlankLinesymsz0(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)z(power< 'type' trailer< '(' x=any ')' > >csPeZdZdZdeeeefZfddZddZddZ	d	d
Z
ddZZS)
	FixIdiomsTa
        isinstance=comparison< %s %s T=any >
        |
        isinstance=comparison< T=any %s %s >
        |
        while_stmt< 'while' while='1' ':' any+ >
        |
        sorted=any<
            any*
            simple_stmt<
              expr_stmt< id1=any '='
                         power< list='list' trailer< '(' (not arglist<any+>) any ')' > >
              >
              '\n'
            >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
        |
        sorted=any<
            any*
            simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
    cs8tt||}|r4d|kr4|d|dkr0|SdS|S)NsortedZid1Zid2)superr	match)selfnoder)	__class__./usr/lib/python3.7/lib2to3/fixes/fix_idioms.pyrOszFixIdioms.matchcCsHd|kr|||Sd|kr(|||Sd|kr<|||StddS)N
isinstancewhiler
z
Invalid match)transform_isinstancetransform_whiletransform_sortRuntimeError)r
rresultsrrr	transformZszFixIdioms.transformcCsh|d}|d}d|_d|_ttd|t|g}d|kr\d|_ttjtd|g}|j|_|S)NxT rnnot)cloneprefixrrrrrZnot_test)r
rrrrZtestrrrrdszFixIdioms.transform_isinstancecCs |d}|td|jddS)NrTrue)r")replacerr")r
rrZonerrrrpszFixIdioms.transform_whilecCs|d}|d}|d}|d}|r>|td|jdn8|rn|}d|_|ttd|g|jdntd||j}d	|kr|r|d	d
|d
jf}	d		|	|d
_nH|j
st|jdkstt
}
|j
|
|j|
kst|d	d
|
_dS)Nsortnextlistexprr
)r"rzshould not have reached here
)getr$rr"r!rrremove
rpartitionjoinparentAssertionErrorZnext_siblingrZappend_child)r
rrZ	sort_stmtZ	next_stmtZ	list_callZsimple_exprnewZbtwnZprefix_linesZend_linerrrrts0



zFixIdioms.transform_sort)
__name__
__module____qualname__ZexplicitTYPECMPZPATTERNrrrrr
__classcell__rr)rrr	%s'
r	N)__doc__rrZ
fixer_utilrrrrrrr6r5ZBaseFixr	rrrr<module>s