168 matching pages, found in 346 ms
Ask StyxWritten on your GPU machine; takes a few seconds the first time.
-
peps.python.orghttps://peps.python.org › pep-0709PEP 709 – Inlined comprehensions | peps.python.org
More about peps.python.org
… GET_ITER 6 LOAD_FAST_AND_CLEAR 1 (x) 8 SWAP 2 10 BUILD_LIST 0 12 SWAP 2 >> 14 FOR_ITER 4 (to 26) 18 STORE_FAST 1 (x) 20 LOAD …
-
peps.python.orghttps://peps.python.org › pep-0456PEP 456 – Secure and interchangeable hash algorithm | peps.python.org
More about peps.python.org
… 2 * sys . maxsize + 1 x = hashsecret . prefix x = ( x ^ ( ord ( p [ 0 ]) << 7 )) & mask for c in p : x = (( 1000003 * x ) ^ ord ( c )) & mask x = ( x ^ len ( p )) & mask x = ( x ^ hashsecret …
-
peps.python.orghttps://peps.python.org › pep-0558PEP 558 – Defined semantics for locals() | peps.python.org
More about peps.python.org
… example: def f (): exec ( "x = 1" ) print ( locals () . get ( "x" )) f () prints 1 , but: def f (): exec ( "x = 1" ) print ( locals () . get ( "x" )) x = 0 f () prints None (the default value from …
-
peps.python.orghttps://peps.python.org › pep-0218PEP 218 – Adding a Built-In Set Object Type | peps.python.org
More about peps.python.org
… tests and methods: S.add(x) Add “x” to the set. S.update(s) Add all elements of sequence “s” to the set. S.remove(x) Remove “x” from the set. If “x” is not …
-
peps.python.orghttps://peps.python.org › pep-0213PEP 213 – Attribute Access Handlers | peps.python.org
More about peps.python.org
… class C : def get_x ( self ): return self . __x def set_x ( self , v ): self . __x = v x = getset ( get_x , set_x ) Additional syntactic sugar might be added, or a naming …
-
peps.python.orghttps://peps.python.org › pep-0671PEP 671 – Syntax for late-bound function argument defaults | peps.python.org
More about peps.python.org
… a new opcode QUERY_FAST/QUERY_DEREF, and if unbound, evaluates the original expression. This opcode (available only for fast locals and closure variables) pushes True onto the stack if the given …
-
peps.python.orghttps://peps.python.org › pep-0280PEP 280 – Optimizing access to globals | peps.python.org
More about peps.python.org
PEP 280 – Optimizing access to globals PEP 280 – Optimizing access to globals Author : Guido van Rossum <guido at python.org> Status : Deferred Type : Standards Track Created : 10-Feb-2002 Python-Version : 2.3 Post …
-
peps.python.orghttps://peps.python.org › pep-0275PEP 275 – Switching on Multiple Values | peps.python.org
More about peps.python.org
… to this: def whatis ( x ): switch ( x ): case 'one' : print '1' case 'two' : print '2' case 'three' : print '3' else : print "D'oh!" into (omitting POP_TOP’s and SET_LINENO’s): 6 LOAD_FAST …
-
peps.python.orghttps://peps.python.org › pep-0246PEP 246 – Object Adaptation | peps.python.org
More about peps.python.org
… that, for any object X and any protocol Y, can be used to ask the Python environment for a version of X compliant with Y. Behind the scenes, the mechanism asks object …
-
peps.python.orghttps://peps.python.org › pep-0698PEP 698 – Override Decorator for Static Typing | peps.python.org
More about peps.python.org
… Parent : def foo ( self , x : int ) -> int : return x class Child ( Parent ): def foo ( self , x : int ) -> int : return x + 1 def parent_callsite ( parent : Parent ) -> None : parent . foo ( 1 ) def child …
Search for “Fast X site:peps.python.org” on Google, or add !ddg, !w and other shortcuts to any search.