
БRMc        `   @   s_  d  d k  Z  d  d k Z d  d k l Z l Z d  d k l Z l Z d  d k l Z l	 Z	 d  d k
 l Z d  d k l Z d  d k l Z d  d k l Z d  d	 k l Z d  d
 k l Z d  d k l Z l Z d  d k l Z d  d k l Z d  d k l Z d  d k Z d  d k  Z  d  d k! Z! d d d d g Z" e d  Z# d e$ f d     YZ% d e% f d     YZ& d e f d     YZ' d e f d     YZ( d e) f d     YZ* d   Z+ d e+ _, d e$ f d     YZ- d e( f d      YZ. d! e$ f d"     YZ/ e/   Z0 d# d$ d% g  f d& d& d' g  f d( d( d' g  f d) d) d% d* g f d+ d+ d% d, g f d- d- d' d. g f d/ d/ d' d0 g f d1 d1 d% d2 g f d3 d3 d' d4 g f d5 d5 d' d6 g f d7 d7 d% d8 g f d9 d9 d: d; g f d< d< d% d= g f d> d> d% d? g f d@ d@ d: dA g f dB dB d% dC g f dD dD d: dE g f dF dF dG dH g f dI dI d: dJ g f dK dK d' dL g f dM dM d' dN g f dO dO d' dP g f dQ dR d' dS g f dT dT d' dU g f dV dV d' dW g f dX dX d' dY g f dZ dZ d' g  f d[ d\ d' d] g f d^ d_ d% d` da g f db dc d% dd de g f df dg d% dh di g f dj dk d% dl dm g f dn do d% dp dq g f dr dr d% ds dt g f du dv d% dw dx g f dy dy d% dz d{ g f d| d} d: d~ d g f d d d% d d g f d d d% d d g f d d d% d d g f d d d% d d g f d d d% d d g f d d d' d g f d d d' d g f d d d' d g f d d d' d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d g f d d d% d d g f d d d% d d g f d d d% d d g f d d d% d d g f d d d% d d g f d d d% d d g f d d d% d g f d d d% d d g f d d d% d g f d d d' d g f d d d' d g f d d d: d g f d d d: d g f d d d% d g f d d d' d g f d d d' d g f gK e- _1 d d g e- _2 d d d d d g e- _3 d d d d d d d d d d d d d d d d d ddddddddd	d
dddddg  e- _4 ddddddddddddddddd g e- _5 d S(!  iN(   t   ExecutionContextt
   ActionFlag(   t   UserDelActiont   FrameTraceAction(   t   OperationErrort   operationerrfmt(   t	   Arguments(   t   ThreadLocals(   t   Cache(   t   HUGEVAL_BYTES(   t   we_are_translated(   t   make_sure_not_resized(   t
   DummyTimert   Timer(   t   r_uint(   t   jit(   t   func_with_new_namet   ObjSpaceR   t	   Wrappablet   W_Rootl    c           B   s  e  Z d  Z d Z e Z e Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z d	 d
  Z d   Z d d  Z d   Z d   Z d   Z d   Z d   Z d   Z e Z e d  Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! RS(   sq   This is the abstract root class of all wrapped objects that live
    in a 'normal' object space like StdObjSpace.c         C   s   d  S(   N(   t   None(   t   self(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   getdict   s    c         C   s1   |  i    } | d  j	 o | i | |  Sn d  S(   N(   R   R   t   finditem_str(   R   t   spacet   attrt   w_dict(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   getdictvalue!   s    c         C   s8   |  i    } | d  j	 o | i | | |  t Sn t S(   N(   R   R   t   setitem_strt   Truet   False(   R   R   R   t   w_valueR   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   setdictvalue'   s
    c         C   sn   |  i    } | d  j	 oQ y | i | |  t SWqj t j
 o& } | i | | i  p   qf qj Xn t S(   N(   R   R   t   delitemR   R   t   matcht
   w_KeyErrorR   (   R   R   t   w_nameR   t   ex(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   deldictvalue.   s    c         C   s1   | i  |   i |  } t | i d |   d  S(   Ns2   attribute '__dict__' of %s objects is not writable(   t   typet   getnameR   t   w_TypeError(   R   R   R   t   typename(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   setdict9   s    	c         C   s   | i  |  i  S(   N(   t   gettypeobjectt   typedef(   R   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   getclass@   s    c         C   s   t  | i | i d    d  S(   Ns)   __class__ assignment: only for heap types(   R   R)   t   wrap(   R   R   t	   w_subtype(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   setclassC   s    	c         C   s   t  d   d  S(   Ns5   only for interp-level user subclasses from typedef.py(   t   NotImplementedError(   R   R   R0   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt
   user_setupG   s    t   ?c         C   sy   y& | i  | i |  | i d    SWnL t j
 o@ } | i | | i  p | i | | i  o | Sn   n Xd  S(   Nt   __name__(   t   str_wt   getattrR/   R   R"   R)   t   w_AttributeError(   R   R   t   defaultt   e(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR(   K   s    &,c         C   s   | i  |   } | i d  } | i d  } d t } d g | } x t o | i | i | |   } | t d  7} | t d  j o" | t d  t d  d 7} n | d 8} t |  | | <| d	 j o Pn | i | |  } qG Wd
 i	 |  S(   Ni   i   i   t    t   0t   9t   ai   i    t    (
   t   idR/   R	   R   t   int_wt   and_t   ordt   chrt   rshiftt   join(   R   R   t   w_idt   w_4t   w_0x0Ft   it
   addrstringt   n(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   getaddrstringS   s"    
 "
R?   c         C   s)   |  i  |  } | i d | | | f  S(   Ns   <%s at 0x%s%s>(   RM   R/   (   R   R   t   infot   moreinfoRK   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   getreprf   s    c         C   s
   t   d  S(   N(   R2   (   R   t   index(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   getslotvaluek   s    c         C   s
   t   d  S(   N(   R2   (   R   RQ   t   w_val(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   setslotvaluen   s    c         C   sW   | d  j o
 d } n t |  } d } t | i | | |  i |  i |    d  S(   NR4   s&   '%s' object expected, got '%s' instead(   R   t   wrappable_class_nameR   R)   R.   R(   (   R   R   t   opnamet   RequiredClasst   argst	   classnamet   msg(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   descr_call_mismatchq   s    
c         C   s   d  S(   N(   R   (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt
   getweakref|   s    c         C   s1   | i  |   i |  } t | i d |   d  S(   Ns+   cannot create weak reference to '%s' object(   R'   R(   R   R)   (   R   R   t   weakreflifelineR*   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt
   setweakref   s    	c         C   s>   |  i    } | d j	 o! |  i | i d  | i   n d S(   s   Call this at the beginning of interp-level __del__() methods
        in subclasses.  It ensures that weakrefs (if any) are cleared
        before the object is further destroyed.
        N(   R\   R   R^   R   t   clear_all_weakrefs(   R   t   lifeline(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR_      s    c         C   sR   t    p |  i o d Sn t |  _ n |  i   | o | i i |   n d S(   s   Put the object in the destructor queue of the space.
        At a later, safe point in time, UserDelAction will use
        space.userdel() to call the object's app-level __del__ method.
        N(   R
   t)   _W_Root__already_enqueued_for_destructionR   R_   t   user_del_actiont   register_dying_object(   R   R   t   call_user_del(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _enqueue_for_destruction   s    


c         C   s   d  S(   N(    (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _call_builtin_destructor   s    c         C   s   d  S(   N(   R   (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _get_mapdict_map   s    c         C   s
   t   d  S(   N(   R2   (   R   t   map(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _set_mapdict_map   s    c         C   s
   t   d  S(   N(   R2   (   R   RQ   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _mapdict_read_storage   s    c         C   s
   t   d  S(   N(   R2   (   R   RQ   t   value(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _mapdict_write_storage   s    c         C   s
   t   d  S(   N(   R2   (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _mapdict_storage_length   s    c         C   s
   t   d  S(   N(   R2   (   R   t   storageRh   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _set_mapdict_storage_and_map   s    (    ("   R5   t
   __module__t   __doc__t	   __slots__R   t	   _settled_R   t   user_overridden_classR   R   R    R&   R+   R.   R1   R3   R(   RM   RP   RR   RT   R[   R\   R^   R_   Ra   Re   Rf   Rg   Ri   Rj   Rl   Rm   Ro   (    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR      s<   																					c           B   s#   e  Z d  Z d Z e Z d   Z RS(   s   A subclass of Wrappable is an internal, interpreter-level class
    that can nevertheless be exposed at application-level by space.wrap().c         C   s   |  S(   N(    (   R   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   __spacebind__   s    (    (   R5   Rp   Rq   Rr   R   Rs   Ru   (    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR      s   t   InternalSpaceCachec           B   s    e  Z d  Z d   Z d   Z RS(   s   A generic cache for an object space.  Arbitrary information can
    be attached to the space by defining a function or class 'f' which
    can be called as 'f(space)'.  Its result is stored in this
    ObjSpaceCache.
    c         C   s   t  i |   | |  _ d  S(   N(   R   t   __init__R   (   R   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRw      s    c         C   s   | |  i   S(   N(   R   (   R   t   callable(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _build   s    (   R5   Rp   Rq   Rw   Ry   (    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRv      s   	t
   SpaceCachec           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s)   A base class for all our concrete caches.c         C   s   t  i |   | |  _ d  S(   N(   R   Rw   R   (   R   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRw      s    c         C   s8   |  i  i   } z |  i |  SWd  |  i  i |  Xd  S(   N(   R   t   enter_cache_building_modet   buildt   leave_cache_building_mode(   R   t   keyt   val(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRy      s    c         C   s8   |  i  i   } z |  i |  SWd  |  i  i |  Xd  S(   N(   R   R{   t   readyR}   (   R   t   resultR   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _ready   s    c         C   s   d  S(   N(    (   R   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR      s    (   R5   Rp   Rq   Rw   Ry   R   R   (    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRz      s
   			t   DescrMismatchc           B   s   e  Z RS(    (   R5   Rp   (    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR      s   c         C   s6   y |  i  i SWn! t j
 o d |  i f Sn Xd  S(   Ns   internal subclass of %s(   R-   t   namet   AttributeErrorR5   (   t   Class(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRU      s    s   specialize:memoc           B   s  e  Z d  Z e Z ds d  Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z e d  Z d	   Z d
 d d d d d d d d d d d d d d d d d d g Z d   Z d   Z d   Z d    Z d!   Z d"   Z d#   Z d$   Z d%   Z d&   Z e i d'    Z d(   Z d)   Z d*   Z  ds d+  Z! d,   Z" d-   Z# d.   Z$ d/   Z% d0   Z& d1   Z' d2   Z( d3   Z) d4   Z* d5   Z+ d6   Z, d7   Z- d8   Z. d9   Z/ d:   Z0 d;   Z1 d< e1 _2 e d=  Z3 d< e3 _2 d> d?  Z4 e i5 e6 e4 d@   Z7 d> dA  Z8 e8 Z9 d> dB  Z: e i5 dC    Z; dD   Z< ds dE  Z= dF   Z> dG   Z? dH   Z@ dI   ZA dJ   ZB dK   ZC dL   ZD dM   ZE dN   ZF dO   ZG dP   ZH dQ   ZI dR   ZJ dS   ZK dT   ZL dU   ZM e dV  ZN e ds dW  ZO dX   ZP dY eP _2 dZ   ZQ d[   ZR ds d\  ZS d]   ZT d^   ZU d_   ZV d`   ZW da   ZX db   ZY dc   ZZ dd   Z[ de   Z\ df   Z] dg   Z^ dh   Z_ di   Z` dj   Za dk   Zb dl   Zc dm   Zd dn   Ze do   Zf dp   Zg dq   Zh dr   Zi RS(t   s   Base class for the interpreter-level implementations of object spaces.
    http://codespeak.net/pypy/dist/pypy/doc/objspace.htmlc         C   s@  t  |   i |  _ t   |  _ | d j o# d d k l } | d t  } n | |  _	 h  |  _
 h  |  _ d d k } h  |  _ t   |  _ d |  _ t |   |  _ t |   |  _ d d k l } l } | |  _ | |  _ |  i	 i i o d g d |  _ h  |  _ n |  i	 i i o t   |  _  n t!   |  _  |  i"   d S(   s-   NOT_RPYTHON: Basic initialization of objects.i(   t   get_pypy_configt   translatingN(   t   cpython_magict   default_magici    i   (#   Rv   t
   getorbuildt	   fromcacheR   t   threadlocalsR   t   pypy.config.pypyoptionR   R   t   configt   builtin_modulest   reloading_modulest   pypy.interpreter.nestedscopet   interned_stringsR   t
   actionflagt   check_signal_actionR   Rb   R   t   frame_trace_actiont   pypy.interpreter.pycodeR   R   t	   our_magict
   host_magict   objspacet   logbytecodest   bytecodecountst   bytecodetransitioncountt   timingR   t   timerR   t
   initialize(   R   R   R   t   pypyR   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRw      s0    							c         C   s  d d k  l } |  i i d  } x |  i |  i i d   D] } y |  i | |  } Wn5 t j
 o) } | i |  |  i  o q> n   n X|  i	 |  } |  i
 |  } t | |  o9 |  i i d |  | i |   |  i i d |  q> q> Wd  S(   Ni(   t   Modulet   modulest   builtin_module_namess   startup (   t   pypy.interpreter.moduleR   t   syst   gett   unpackiterablet   getitemR   R"   R#   R6   t   interpclass_wt
   isinstanceR   t   startt   initt   stop(   R   R   t	   w_modulest	   w_modnamet   w_modR:   t   modnamet   mod(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   startup  s"    	 c         C   s$  |  i    |  i i |  d  } | d  j	 o |  i |  n d d k l } xQ |  i i   D]@ } |  i	 |  } t
 | |  o | i o | i |   q] q] W|  i i i i o d d k l } |   n |  i i i o |  i   n |  i i i i o  x |  i i D] } | GHqWn d  S(   Nt   exitfunci(   R   (   t   report(   t   wait_for_thread_shutdownR   R   R   t   call_functionR   R   R   t   valuesR   R   t   startup_calledt   shutdownR   R   t   stdt   withdictmeasurementt!   pypy.objspace.std.dictmultiobjectR   R   t   reportbytecodecountst   logspaceoptypest
   FrameClasst   _space_op_types(   R   t
   w_exitfuncR   R   R   R   t   s(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   finish/  s&    
  c         C   s   |  i  i i p d Sn |  i i d  } |  i | d  } | d j o d Sn y |  i | d  Wn% t j
 o } | i	 |  d  n Xd S(   s   Wait until threading._shutdown() completes, provided the threading
        module was imported in the first place.  The shutdown routine will
        wait until all non-daemon 'threading' threads have completed.NR   t	   threadingt	   _shutdowns   threading._shutdown()(
   R   t   translationt   threadR   R   R   R   t   call_methodR   t   write_unraisable(   R   R   R   R:   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR   B  s    c      	   C   sj  t  i d d  t  i d t  i t  i Bt  i Bd  } t  i | d  xR t t |  i   D]; } |  i | } | p q\ n t  i | d | | f  q\ Wt  i | d  t  i | d  x{ |  i	 i
   D]j \ } } t  i | d	 | f  x4 | i
   D]& \ } } t  i | d
 | | f  q Wt  i | d  q Wt  i | d  t  i |  t  i d d  d  S(   Ni   s   Starting bytecode report.
s   bytecode.txti  s   bytecodecounts = {
s       %s: %s,
s   }
s   bytecodetransitioncount = {
s
       %s: {
s           %s: %s,
s       },
s   Reporting done.
(   t   ost   writet   opent   O_CREATt   O_WRONLYt   O_TRUNCt   ranget   lenR   R   t	   iteritemst   close(   R   t   fdt   opcodet   countt   probst   nextcode(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR   S  s*    &   c         C   s/   y |  i  SWn t j
 o |  i i Sn Xd  S(   N(   t   _this_space_repr_R   t	   __class__R5   (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   __repr__g  s    c         C   s   d | } t  | d d d g  i } | i d j	 o | i } n | } |  i |  } |  i | |  |   } | |  i | <| S(   s@   NOT_RPYTHON. load a lazy pypy/module and put it into sys.moduless   pypy.module.%sR   N(   t
   __import__R   R   t   applevel_nameR/   R   (   R   t
   importnamet   fullnameR   R   R$   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   setbuiltinmodulem  s    
c   	   
   C   s:  |  i  |  } |  i i d  } y |  i | |  } Wn2 t j
 o& } | i |  |  i  p   q{ n X| p | Sn y |  i | } Wn( t j
 o t	 |  i
 d |   n X|  i | | |  d d k l } |  i |  } t | |  o9 |  i i d |  | i |   |  i i d |  n | Sd  S(   NR   s4   getbuiltinmodule() called with non-builtin module %si(   R   s   startup (   R/   R   R   R   R   R"   R#   R   t   KeyErrorR   t   w_SystemErrort   setitemR   R   R   R   R   R   R   R   (	   R   R   t
   force_initR$   R   R   R:   R   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   getbuiltinmodule}  s0    c      
   C   s!  d d k  l } y |  i SWn t j
 o n Xg  } xB |  i i i D]1 \ } } | o | | j o | i |  qG qG Wd | j p d | j o d | j o | i d  n |  i i i	 pM xJ |  i
 D]; } | i | d  i d t  p | i d |  q q Wn | |  _ |  i S(	   t   NOT_RPYTHONi(   t   LIB_PYPYt   time2t   rctimet   times   .pyt   files   faked+(   t   pypy.tool.lib_pypyR   t   _builtinmodule_listR   R   R   t
   usemodulest   appendt   removet   nofakingt   ALL_BUILTIN_MODULESRF   t   checkR   (   R   R   R   R   Rk   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   get_builtinmodule_to_install  s&     '
  	t   posixt   ntt   os2t   mact   cet   riscost   matht   arrayt   selectt   _randomt   _sreR   t   _sockett   errnot   unicodedatat   parsert   fcntlt   _codecst   binasciic         C   s  d d k  l } |  i d  } | |  |  |  _ |  i |  i  |  i d <d d k l } |  i d  } | |  |  |  _ |  i |  i  |  i d <d d k l } |  i d  } |  i | |  |   |  i d <d d k l } |  i d  } | |  |  |  _	 |  i |  i	  } |  i |  |  i d <|  i
 |  i	 i |  i d  |  t d  } t |  } |  i   } t i |  i   i   | i    } x6 | D]. \ } }	 |  i
 |  i	 i |  i |  |	  qWxF |  i   D]8 }
 |
 | j o% |
 i d  o |  i |
 |  qqWxB |  i   D]4 }
 |
 i d  o |
 d	 } |  i | |  q$q$W| i   |  i g  } | D] } | |  i |  qw~  } |  i
 |  i i |  i d
  |  d S(   s-   NOT_RPYTHON: only for initializing the space.i(   R   t
   exceptionsR   t   impt   __builtin__t   __builtins__s   faked+i   R   N(   s   syss   imps   __builtin__s
   exceptions(   t   pypy.module.exceptionsR   R/   t   exceptions_moduleR   t   pypy.module.sysR   t   pypy.module.impt   pypy.module.__builtin__t   builtinR   R   t   sett   listt   export_builtin_exceptionst	   itertoolst   chaint   get_builtin_typesR   R   t
   startswitht   install_mixedmodulet   install_faked_modulet   sortt   newtuple(   R   R   R$   t	   w_builtint   bootstrap_modulest   installed_builtin_modulest   exception_types_wt   types_wR   t   w_typet	   mixednameR   t   _[1]t   fnt   w_builtin_module_names(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   make_builtins  sP    " &  

-c         C   s
   t   d S(   sP   Get a dictionary mapping the names of builtin types to the type
        objects.N(   R2   (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s    c   	      C   s   |  i  i   } |  i | d  } h  } xp |  i |  D]_ } |  i |  } | i d  p: | } |  i | |  } | | | <t |  d | |  q7 q7 W|  i d  } t	 |  i
 |  |  _ | S(   R   t   keyst   __t   w_s    maximum recursion depth exceeded(   R  R   R   R   R6   R  R   t   setattrR/   R   t   w_RuntimeErrort   prebuilt_recursion_error(	   R   t   w_dict   w_keyst   exc_types_wR$   R   t   excnamet   w_exct   w_msg(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s     
	c         C   sI   |  i  |  } | o/ | | j p t d | f  | i |  n d S(   R   sA   duplicate interp-level module enabled for the app-level module %rN(   R   t   AssertionErrorR   (   R   R$  R   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s    c         C   s   t  | h  h  d g  } | S(   s)   NOT_RPYTHON. Steal a module from CPython.t   *(   R   (   R   R   t
   cpy_module(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   load_cpython_module  s    c         C   s   | | j o d Sn y |  i  |  } Wn t j
 o d SnF X|  i i d  } |  i | |  i |  |  i |   | i |  d S(   R   NR   (   R8  t   ImportErrorR   R   R   R/   R   (   R   R   R   t   moduleR   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s    	%c         C   s   |  i  i i i o* d d k l } |  i |  i |   n |  i d  |  i d  |  i d  x! |  i	 i
   D] } | i   qt Wd S(   s-   NOT_RPYTHON: only for initializing the space.i(   t   StateR   R
  R  N(   R   R   R   t   cpyextt   pypy.module.cpyext.stateR;  R   t	   build_apiR   R   R   t    setup_after_space_initialization(   R   R;  R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   setup_builtin_modules*  s     c         C   s   d S(   s^   NOT_RPYTHON: Abstract method that should put some minimal
        content into the w_builtins.N(    (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR   5  s    c         C   s   d S(   s   hook for the flow object spaceN(    (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR{   9  s    c         C   s   d S(   s   hook for the flow object spaceN(    (   R   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR}   ;  s    c         C   s   |  i  i oi t   o^ |  i i   d j p
 t d  y |  i SWqv t j
 o  |  i	   } | |  _ | Sqv Xn |  i i   } | d j o  |  i	   } |  i i
 |  n | S(   s;   Return what we consider to be the active execution context.s8   threadlocals got an ExecutionContext during translation!N(   R   R   R
   R   t   getvalueR   R5  t   _ec_during_translationR   t   createexecutioncontextt   setvalue(   R   t   ec(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   getexecutioncontext>  s    	c         C   s   t  S(   N(   R   (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   _freeze_W  s    c         C   s
   t  |   S(   s(   Factory function for execution contexts.(   R    (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRC  Z  s    c         C   sN   y |  i  SWn< t j
 o0 d d k l } | |   } | |  _  | Sn Xd S(   s,   Factory function creating a compiler object.i(   t   PythonAstCompilerN(   t   default_compilerR   t   pypy.interpreter.pycompilerRH  (   R   RH  t   compiler(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   createcompiler^  s    	c         C   s   |  i  |  | | |  S(   s6   Create an empty PyFrame suitable for this code object.(   R   (   R   t   codet	   w_globalst   closure(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   createframei  s    c         C   s)   |  i  i i i o |  i   Sn t Sd S(   sf   Return an interp-level Lock object if threads are enabled,
        and a dummy object if they are not.N(   R   R   R   R   t   _ObjSpace__allocate_lockt
   dummy_lock(   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   allocate_lockm  s    c         C   sV   d d k  l } l } y |   SWn. | j
 o" t |  i |  i d    n Xd  S(   Ni(   RS  t   errors   out of resources(   t   pypy.module.thread.ll_threadRS  RT  R   R-  R/   (   R   RS  RT  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   __allocate_lockw  s    	c         C   s   |  i  |  i |   S(   N(   R/   t   is_true(   R   t   w_obj(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   not_  s    c         C   s,   |  i  | |  p |  i |  i | |   S(   s4   shortcut for space.is_true(space.eq(w_obj1, w_obj2))(   t   is_wRW  t   eq(   R   t   w_obj1t   w_obj2(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   eq_w  s    c         C   s   |  i  |  i | |   S(   s5   shortcut for space.is_true(space.is_(w_obj1, w_obj2))(   RW  t   is_(   R   R\  R]  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRZ    s    c         C   s   |  i  |  i |   S(   s+   shortcut for space.int_w(space.hash(w_obj))(   RA   t   hash(   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   hash_w  s    c         C   s   |  i  |  i |   S(   s)   shotcut for space.int_w(space.len(w_obj))(   RA   R   (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   len_w  s    c         C   s   |  i  | |  i |  |  S(   N(   R   R/   (   R   RX  R~   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR     s    c         C   s   |  i  | |  i |   S(   N(   t   finditemR/   (   R   RX  R~   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR     s    c         C   sQ   y |  i  | |  SWn6 t j
 o* } | i |  |  i  o d  Sn   n Xd  S(   N(   R   R   R"   R#   R   (   R   RX  t   w_keyR:   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRc    s    c         C   sK   y |  i  | |  SWn0 t j
 o$ } | i |   o   n d  Sn Xd  S(   N(   R7   R   t   asyncR   (   R   t   w_objectR$   R:   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   findattr  s    c         C   s   | o |  i  Sn |  i Sd  S(   N(   t   w_Truet   w_False(   R   t   b(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   newbool  s    c         C   sE   |  i  |  } y |  i | SWn t j
 o n X| |  i | <| S(   N(   R6   R   R   (   R   t   w_sR   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   new_interned_w_str  s    c         C   sC   y |  i  | SWn t j
 o n X|  i |  } |  i  | <| S(   N(   R   R   R/   (   R   R   Rl  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   new_interned_str  s    c         C   s   t  | t  o | Sn d S(   s   
         If w_obj is a wrapped internal interpreter class instance unwrap to it,
         otherwise return None.  (Can be overridden in specific spaces; you
     should generally use the helper space.interp_w() instead.)
        N(   R   R   R   (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR     s    c         C   s0   |  i  |  } t | |  p t    n | S(   N(   R   R   R   (   R   RW   RX  t   obj(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   descr_self_interp_w  s    s   specialize:arg(1)c         C   s   | d j	 p t  | o |  i | |  i  o d Sn |  i |  } t | |  p: d } t |  i | t |  | i	 |   i
 |     n | S(   s   
        Unwrap w_obj, checking that it is an instance of the required internal
        interpreter class (a subclass of Wrappable).
        s&   '%s' object expected, got '%s' insteadN(   R   R5  RZ  t   w_NoneR   R   R   R)   RU   R.   R(   (   R   RW   RX  t   can_be_NoneRo  RZ   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   interp_w  s    	ic   	      C   s/  |  i  |  } g  } x t o y |  i |  } Wn3 t j
 o' } | i |  |  i  p   n Pn X| d j o2 t |  | j o t |  i |  i d    n | i	 |  q W| d j oe t |  | j  oR t |  } | d j o
 d } n d } t |  i |  i d | | f    n | S(   s   Unpack an iterable object into a real (interpreter-level) list.
        Raise an OperationError(w_ValueError) if the length is wrong.is   too many values to unpacki   R?   R   s#   need more than %d value%s to unpack(
   t   iterR   t   nextR   R"   t   w_StopIterationR   t   w_ValueErrorR/   R   (	   R   t
   w_iterablet   expected_lengtht
   w_iteratort   itemst   w_itemR:   RJ   t   plural(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR     s.      	 
		t   unpackiterable_unrollc         C   s   t  |  i | |   S(   sB    A fixed list view of w_iterable. Don't modify the result
        (   R   R   (   R   Rx  Ry  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt	   fixedview  s    c         C   s   |  i  | |  S(   sA    A non-fixed view of w_iterable. Don't modify the result
        (   R   (   R   Rx  Ry  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   listview  s    c         C   s   |  i  | |  o t Sn yp |  i |  i | |  i   o= x: |  i |  D]! } |  i | |  o t SqM qM Wt Sn |  i | |  SWn6 t	 j
 o* } | i
 |  |  i  o t Sn   n Xd S(   s;   Checks if the given exception type matches 'w_check_class'.N(   RZ  R   RW  R   t   w_tupleR  t   exception_matchR   t   exception_issubclass_wR   R"   R)   (   R   t
   w_exc_typet   w_check_classt   w_tR:   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s     c         C   sa   |  i  i i p8 d d k l } t | |  o | i | |  SqH n |  i | | i |   S(   Ni(   t   Function(	   R   R   t   disable_call_speedhackst   pypy.interpreter.functionR  R   t   call_obj_argst	   call_argst   prepend(   R   t
   w_callableRX  RX   R  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR  #  s
    c         C   s%   t  i |  | |  } |  i | |  S(   N(   R   t
   frompackedR  (   R   R  t   w_argst   w_kwdsRX   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   call,  s    c   	      G   s$  t  |  } |  i i i o | d j  o d d k l } l } t | |  o | i } | d  j	 oB | d j  o1 | i
 } t | |  o | i | |  Sq q q | o' |  i | d | i  o | i
 } q n t | |  o | i |   Sq n t |  t |   } |  i | |  S(   Ni   i(   R  t   Methodi   i    (   R   R   R   R  R  R  R  R   t
   w_instanceR   t
   w_functiont   funccallt   abstract_isinstance_wt   w_classR   R  R  (	   R   t   w_funct   args_wt   nargsR  R  t   w_instt   funcRX   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR   0  s"    		c   	      C   s>  d d k  l } l } l } | i o3 | |  o& | i |  } |  i | | |  Sn |  i i i	 p t
 | |  o~ | i } | d  j	 o' | i } | i | |  | d 7} q | d j o0 |  i | i | d  | i  o | i } q n t
 | |  o | i | |  Sqn | i |  } |  i | |  S(   Ni(   R  R  t   is_builtin_codei   i    (   R  R  R  R  t   is_being_profiledt   make_argumentst   call_args_and_c_profileR   R   R  R   R  R   R  t   settopvalueR  t	   peekvalueR  t   funccall_valuestackR  (	   R   R  R  t   frameR  R  R  RX   R  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   call_valuestackG  s&    		c         C   s   |  i    } | i | | |  y |  i | |  } Wn7 t j
 o+ } | i |   } | i | |    n X| i | | |  | S(   N(   RF  t   c_call_traceR  R   t   get_w_valuet   c_exception_tracet   c_return_trace(   R   R  R  RX   RE  t   w_resR:   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR  d  s    c         G   s+   |  i  | |  i |   } |  i | |  S(   N(   R7   R/   R   (   R   RX  t   methnamet   arg_wt   w_meth(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR   p  s    c         C   so   |  i  |  } |  i | |  i d   } x> |  i |  D]- } | i |  |  } | d  j	 o | Sq: q: Wd  S(   Nt   __mro__(   R'   R7   R/   R  R   R   (   R   RX  R   R#  t   w_mrot   w_supertypeR   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   lookupt  s     c         C   s9   d d k  l } |  i |  } | d  j	 o t | |  S(   Ni(   t   W_InstanceObject(   t'   pypy.module.__builtin__.interp_classobjR  R   R   R   (   R   RX  R  Ro  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   is_oldstyle_instance}  s    c         C   s   |  i  | d  d  j	 o |  i |  od y$ |  i | |  i d   |  i SWq t j
 o- } | i |  |  i  p   n |  i	 Sq Xq |  i Sn |  i	 S(   Nt   __call__(
   R  R   R  R7   R/   Rh  R   R"   R8   Ri  (   R   RX  R:   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRx     s    c         C   s   |  i  |  i | |   S(   N(   RW  R   (   R   RX  R#  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   isinstance_w  s    c         C   s   |  i  |  i | |   S(   N(   RW  t	   issubtype(   R   t   w_cls1t   w_cls2(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   abstract_issubclass_w  s    c         C   s   |  i  |  i | |   S(   N(   RW  R   (   R   RX  t   w_cls(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s    c         C   s   |  i  |  i | |  i   S(   N(   RW  R   R#  (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   abstract_isclass_w  s    c         C   s   |  i  |  S(   N(   R'   (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   abstract_getclass  s    c         C   sL   |  i  | |  i  p t Sn |  i p t Sn |  i |  i | |  i   S(   N(   R  R#  R   t   full_exceptionsR   RW  R  t   w_BaseException(   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt!   exception_is_valid_obj_as_class_w  s
    
c         C   s.   |  i  p t Sn |  i |  i | |  i   S(   N(   R  R   RW  R  R  (   R   R  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   exception_is_valid_class_w  s    
c         C   s   |  i  |  S(   N(   R'   (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   exception_getclass  s    c         C   s   |  i  |  i | |   S(   N(   RW  R  (   R   R  R  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s    c      	   C   s   d d k  } d d k l } t | t  o. |  i   } | i | d d d d | } n t | | i  o | i |  |  } n t | |  p t	 d  n | i
 |  | |  S(	   s$   NOT_RPYTHON: For internal debugging.iN(   t   PyCodeR4   t   evali    t   hidden_applevels6   space.eval(): expected a string, code or PyCode object(   t   typesR   R  R   t   strRL  t   compilet   CodeTypet
   _from_codet	   TypeErrort	   exec_code(   R   t
   expressionRN  t   w_localsR  R  R  RK  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s    c   
   	   C   s  d d k  } | d j o
 d } n d d k l } t | t  o. |  i   } | i | | d d d | } n t | | i  o | i	 |  |  } n t | |  p t
 d  n |  i d	  }	 |  i |  i | |	   p# |  i | |	 |  i |  i   n | i |  | |  S(
   s$   NOT_RPYTHON: For internal debugging.iNR4   (   R  t   execi    R  s7   space.exec_(): expected a string, code or PyCode objectR  (   R  R   R   R  R   R  RL  R  R  R  R  R/   RW  t   containsR   R  R  (
   R   t	   statementRN  R  R  t   filenameR  R  RK  Rd  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   exec_  s     
#c         C   s=   |  i  t  i |  } t |  t |   } |  i | |  S(   s    return value from executing given source at applevel.
            EXPERIMENTAL. The source must look like
               '''(x, y):
                       do_stuff...
                       return result
               '''
        (   R   t   AppExecCacheR   R   R  R  (   R   t	   posargs_wt   sourceR  RX   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   appexec  s    s   specialize:arg(2)c         C   s   |  i  |  i | |  i   oF d d k l } t | |  p t  | i |  |  \ } } } nt |  i |  } | d j  o | | 7} n d | j o
 | j  n p t |  i	 |  i
 d    n d } d } | | | f S(   sx   Helper for custom sequence implementations
             -> (index, 0, 0) or
                (start, stop, step)
        i(   t   W_SliceObjecti    s   index out of range(   RW  R   t   w_slicet   pypy.objspace.std.sliceobjectR  R5  t   indices3RA   R   t   w_IndexErrorR/   (   R   t   w_index_or_slicet	   seqlengthR  R   R   t   step(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   decode_index  s    	c         C   s   |  i  |  i | |  i   oI d d k l } t | |  p t  | i |  |  \ } } } } nz |  i |  } | d j  o | | 7} n d | j o
 | j  n p t |  i	 |  i
 d    n d } d } d } | | | | f S(   s   Helper for custom sequence implementations
             -> (index, 0, 0, 1) or
                (start, stop, step, slice_length)
        i(   R  i    s   index out of rangei   (   RW  R   R  R  R  R5  t   indices4RA   R   R  R/   (   R   R  R  R  R   R   R  t   length(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   decode_index4  s    		c         C   sA  y |  i  |  } Wnp t j
 od } | d j p | i |  |  i  o   n d } t |  i | | |  i |  i |     n Xy |  i |  } Wn t j
 o } | i |  |  i	  p   n | p@ |  i
 |  i | |  i d    o t i d Sq4t i Sq=t | d |  i |  i |     n X| Sd S(   s   Return w_obj.__index__() as an RPython int.
        If w_exception is None, silently clamp in case of overflow;
        else raise w_exception.
        s   %s must be an integer, not %si    i   s+   cannot fit '%s' into an index-sized integerN(   RQ   R   R   R"   R)   R   R'   R(   RA   t   w_OverflowErrorRW  t   ltR/   R   t   maxint(   R   RX  t   w_exceptiont   objdescrt   w_indext   errRZ   RQ   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt
   getindex_w  s,    $#% c         C   sR   |  i  |  } y | i   SWn. t j
 o" t |  i |  i d    n Xd  S(   Ns   integer too large(   t   bigint_wt
   tolonglongt   OverflowErrorR   R  R/   (   R   RX  t   bigint(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   r_longlong_w>  s    	c         C   s   |  i  |  } y | i   SWn[ t j
 o" t |  i |  i d    n/ t j
 o" t |  i |  i d    n Xd  S(   Ns   integer too larges/   cannot convert negative integer to unsigned int(   R  t   toulonglongR  R   R  R/   t
   ValueErrorRw  (   R   RX  R  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   r_ulonglong_wF  s    		c         C   s/   d d k  l } |  i |  } |  i | |  S(   Ni(   t   Buffer(   t   pypy.interpreter.bufferR  t   bufferRs  (   R   RX  R  t   w_buffer(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   buffer_wR  s    c         C   sR   d d k  l } |  i |  } t | |  p t |  i |  i d    n | S(   Ni(   t   RWBuffers   read-write buffer expected(   R  R  R  R   R   R)   R/   (   R   RX  R  R  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt
   rwbuffer_wX  s    	c         C   s   |  i  |  } | i   S(   N(   R  t   as_str(   R   RX  R  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   bufferstr_new_wa  s    c         C   sc   y |  i  |  SWnK t j
 o? } | i |  |  i  p   n |  i |  } | i   Sn Xd  S(   N(   R6   R   R"   R)   R  R  (   R   RX  R:   R  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   bufferstr_wh  s    	c         C   s+   |  i  | |  i  o d  Sn |  i |  S(   N(   RZ  Rq  R   R6   (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   str_or_None_wy  s    c         C   sK   |  i  |  i | |  i   p t |  i |  i d    n |  i |  S(   Ns   argument must be a string(   RW  R   t   w_strR   R)   R/   R6   (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt	   realstr_w~  s    	c         C   sK   |  i  |  i | |  i   p t |  i |  i d    n |  i |  S(   Ns   argument must be a unicode(   RW  R   t	   w_unicodeR   R)   R/   t	   unicode_w(   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   realunicode_w  s    	c         C   s   t  |  i |   S(   N(   t   boolRA   (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   bool_w  s    c         C   sT   |  i  |  i | |  i   o t |  i |  i d    n |  i |  i |   S(   Ns$   integer argument expected, got float(   RW  R   t   w_floatR   R)   R/   RA   t   int(   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   gateway_int_w  s    	c         C   s   |  i  |  i |   S(   N(   t   float_wt   float(   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   gateway_float_w  s    c         C   sT   |  i  |  i | |  i   o t |  i |  i d    n |  i |  i |   S(   Ns$   integer argument expected, got float(   RW  R   R  R   R)   R/   R  R  (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   gateway_r_longlong_w  s    	c         C   sT   |  i  |  i | |  i   o t |  i |  i d    n |  i |  i |   S(   Ns$   integer argument expected, got float(   RW  R   R  R   R)   R/   t   uint_wR  (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   gateway_r_uint_w  s    	c         C   sT   |  i  |  i | |  i   o t |  i |  i d    n |  i |  i |   S(   Ns$   integer argument expected, got float(   RW  R   R  R   R)   R/   R  R  (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   gateway_r_ulonglong_w  s    	c         C   s?   |  i  |  } | d j  o t |  i |  i d    n | S(   Ni    s   expected a non-negative integer(   R  R   Rw  R/   (   R   RX  Rk   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   gateway_nonnegint_w  s
    	c         C   sL   |  i  |  } | d j  p | d j o t |  i |  i d    n | S(   Ni  i   is   expected a 32-bit integeri   (   R  R   R  R/   (   R   RX  Rk   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   c_int_w  s
    	c         C   s?   |  i  |  } | t j o t |  i |  i d    n | S(   Ns#   expected an unsigned 32-bit integer(   R  t   UINT_MAX_32_BITSR   R  R/   (   R   RX  Rk   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   c_uint_w  s
    	c         C   sk   |  i  |  } | d j  o t |  i |  i d    n | d j o t |  i |  i d    n | S(   Ni    s   expected a non-negative integeris   expected a 32-bit integer(   R  R   Rw  R/   R  (   R   RX  Rk   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   c_nonnegint_w  s    		c         C   s  |  i  | |  i  o |  i  | |  i  o y |  i | |  i d   } WnM t j
 oA } | i |  |  i  o t |  i |  i d    n   n X|  i	 |  } |  i  | |  i  p t |  i |  i d    q n |  i
 |  } | d j  o t |  i d |   n | S(   Nt   filenos3   argument must be an int, or have a fileno() method.s   fileno() must return an integeri    s1   file descriptor cannot be a negative integer (%d)(   R  t   w_intt   w_longR7   R/   R   R"   R8   R)   R   RA   R   Rw  (   R   t   w_fdt   w_filenoR:   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   c_filedescriptor_w  s$    			c         C   s#   |  i  |  i |  | g d  d  S(   Nsp   (msg, warningcls):
            import warnings
            warnings.warn(msg, warningcls, stacklevel=2)
        (   R  R/   (   R   RZ   t   w_warningcls(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   warn  s    c         C   s   | S(   sp    A space method that can be used by special object spaces (like
        thunk) to replace an object by another. (    (   R   RX  (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   resolve_target  s    N(j   R5   Rp   Rq   R   R  R   Rw   R   R   R   R   R   R   R   R   R   R   R(  R  R  R  R8  R  R@  R   R{   R}   R   t   loop_invariantRF  RG  RC  RL  RP  RS  RQ  RY  R^  RZ  Ra  Rb  R   R   Rc  Rg  Rk  Rm  Rn  R   Rp  t   _annspecialcase_Rs  R   t   unroll_safeR   R~  R  t   fixedview_unrollR  R  R  R  R   R  R  R   R  R  Rx   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R   R  R  R  R  R  R  R  R  R  R  R  R  R  R  (    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR      s   '						"			5														
																
																											 																									R  c           B   s   e  Z d    Z RS(   c         C   s   |  i  } d d k } | i   } | i d  p t d | f  | i i d |  } | i   } | i t	 |  | |  | i
 | | i d   S(   s    NOT_RPYTHON iNt   (s   incorrect header in:
%ss   def anonymous%s
t	   anonymous(   R   t   pyt   lstripR  R5  RM  t   Sourcet   newdictR  R  R   R/   (   t   cacheR  R   R$  t   w_glob(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR|     s    	!(   R5   Rp   R|   (    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR    s   t	   DummyLockc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   t  S(   N(   R   (   R   t   flag(    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   acquire  s    c         C   s   d  S(   N(    (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyt   release  s    c         C   s   t  S(   N(   R   (   R   (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyRG    s    (   R5   Rp   R,  R-  RG  (    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pyR*    s   		R_  t   isi   R@   i   R'   R   t   __instancecheck__R  t   __subclasscheck__t   reprR   R  t   __str__t   formatt
   __format__R   t   __len__R`  t   __hash__R7   t   __getattribute__R,  i   t   __setattr__t   delattrt   __delattr__R   t   __getitem__R   t   __setitem__R!   t   __delitem__t   getslicet   __getslice__t   setslicei   t   __setslice__t   delslicet   __delslice__t   trunct	   __trunc__t   post   __pos__t   negt   __neg__t   nonzerot   trutht   __nonzero__t   abst   __abs__t   hext   __hex__t   octt   __oct__RC   t   invertt   ~t
   __invert__t   addt   +t   __add__t   __radd__t   subt   -t   __sub__t   __rsub__t   mulR6  t   __mul__t   __rmul__t   truedivt   /t   __truediv__t   __rtruediv__t   floordivs   //t   __floordiv__t   __rfloordiv__t   divt   __div__t   __rdiv__R   t   %t   __mod__t   __rmod__t   divmodt
   __divmod__t   __rdivmod__t   pows   **t   __pow__t   __rpow__t   lshifts   <<t
   __lshift__t   __rlshift__RE   s   >>t
   __rshift__t   __rrshift__RB   t   &t   __and__t   __rand__t   or_t   |t   __or__t   __ror__t   xort   ^t   __xor__t   __rxor__R  t   __int__RQ   t	   __index__R
  t	   __float__t   longt   __long__t   inplace_adds   +=t   __iadd__t   inplace_subs   -=t   __isub__t   inplace_muls   *=t   __imul__t   inplace_truedivs   /=t   __itruediv__t   inplace_floordivs   //=t   __ifloordiv__t   inplace_divs   div=t   __idiv__t   inplace_mods   %=t   __imod__t   inplace_pows   **=t   __ipow__t   inplace_lshifts   <<=t   __ilshift__t   inplace_rshifts   >>=t   __irshift__t   inplace_ands   &=t   __iand__t
   inplace_ors   |=t   __ior__t   inplace_xors   ^=t   __ixor__R  t   <t   __lt__t   __gt__t   les   <=t   __le__t   __ge__R[  s   ==t   __eq__t   nes   !=t   __ne__t   gtt   >t   ges   >=t   cmpt   __cmp__t   coercet
   __coerce__R  t   __contains__Rt  t   __iter__Ru  R   t   __get__R  t   __set__t   deletet
   __delete__t   userdelt   delt   __del__R  t
   __buffer__R  R   R   R   R   t   Ellipsist   NotImplementedt   ArithmeticErrorR5  R   t   EOFErrort   EnvironmentErrort	   Exceptiont   FloatingPointErrort   IOErrorR9  t   IndentationErrort
   IndexErrorR   t   KeyboardInterruptt   LookupErrort   MemoryErrort	   NameErrorR2   t   OSErrorR  t   ReferenceErrort   RuntimeErrort   StandardErrort   StopIterationt   SyntaxErrort   SystemErrort
   SystemExitt   TabErrorR  t   UnboundLocalErrort   UnicodeErrorR  t   ZeroDivisionErrorR/   R6   RA   R	  R  R  R  R   t   unwrapRW  RZ  R  t   newlistR'  t   newsliceR  t	   marshal_w(6   R  R   t!   pypy.interpreter.executioncontextR    R   R   R   t   pypy.interpreter.errorR   R   t   pypy.interpreter.argumentR   t   pypy.interpreter.miscutilsR   t   pypy.tool.cacheR   t   pypy.tool.uidR	   t   pypy.rlib.objectmodelR
   t   pypy.rlib.debugR   t   pypy.rlib.timerR   R   t   pypy.rlib.rarithmeticR   t	   pypy.rlibR   t   pypy.tool.sourcetoolsR   R   R   R$  t   __all__R  t   objectR   R   Rv   Rz   R  R   RU   R  R   R  R*  RR  t   MethodTablet   BuiltinModuleTablet   ConstantTablet   ExceptionTablet   IrregularOpTable(    (    (    s1   /64/home/arigo/u/pypy/interpreter/baseobjspace.pys   <module>   sF  $			    	
