168 matching pages, found in 346 ms

Ask StyxWritten on your GPU machine; takes a few seconds the first time.

  1. peps.python.orghttps://peps.python.org › pep-0709
    More about peps.python.org
    PEP 709 – Inlined comprehensions | 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 …

    0 points
  2. peps.python.orghttps://peps.python.org › pep-0456
    More about peps.python.org
    PEP 456 – Secure and interchangeable hash algorithm | 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 …

    0 points
  3. peps.python.orghttps://peps.python.org › pep-0558
    More about peps.python.org
    PEP 558 – Defined semantics for locals() | 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 …

    0 points
  4. peps.python.orghttps://peps.python.org › pep-0218
    More about peps.python.org
    PEP 218 – Adding a Built-In Set Object Type | 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 …

    0 points
  5. peps.python.orghttps://peps.python.org › pep-0213
    More about peps.python.org
    PEP 213 – Attribute Access Handlers | 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 …

    0 points
  6. peps.python.orghttps://peps.python.org › pep-0671
    More about peps.python.org
    PEP 671 – Syntax for late-bound function argument defaults | 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 …

    0 points
  7. peps.python.orghttps://peps.python.org › pep-0280
    More about peps.python.org
    PEP 280 – Optimizing access to globals | 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 …

    0 points
  8. peps.python.orghttps://peps.python.org › pep-0275
    More about peps.python.org
    PEP 275 – Switching on Multiple Values | 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 …

    0 points
  9. peps.python.orghttps://peps.python.org › pep-0246
    More about peps.python.org
    PEP 246 – Object Adaptation | 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 …

    0 points
  10. peps.python.orghttps://peps.python.org › pep-0698
    More about peps.python.org
    PEP 698 – Override Decorator for Static Typing | 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 …

    0 points

Search for “Fast X site:peps.python.org” on Google, or add !ddg, !w and other shortcuts to any search.