3
Ah`  ã               @   sp   d Z ddlZddlZdd„ Zejejƒdd„ ƒZejejƒdd„ ƒZejejƒd	d
„ ƒZejejƒdd„ ƒZdS )a   
Wrapper for the builtin json module that ensures compliance with the JSON spec.

REST framework should always import this wrapper module in order to maintain
spec-compliant encoding/decoding. Support for non-standard features should be
handled by users at the renderer and parser layer.
é    Nc             C   s   t dt| ƒ ƒ‚d S )Nz2Out of range float values are not JSON compliant: )Ú
ValueErrorÚrepr)Úo© r   úH/tmp/pip-build-9m32_hle/djangorestframework/rest_framework/utils/json.pyÚstrict_constant   s    r   c              O   s   |j ddƒ tj| |ŽS )NÚ	allow_nanF)Ú
setdefaultÚjsonÚdump)ÚargsÚkwargsr   r   r   r      s    r   c              O   s   |j ddƒ tj| |ŽS )Nr   F)r	   r
   Údumps)r   r   r   r   r   r      s    r   c              O   s   |j dtƒ tj| |ŽS )NÚparse_constant)r	   r   r
   Úload)r   r   r   r   r   r      s    r   c              O   s   |j dtƒ tj| |ŽS )Nr   )r	   r   r
   Úloads)r   r   r   r   r   r   "   s    r   )	Ú__doc__Ú	functoolsr
   r   Úwrapsr   r   r   r   r   r   r   r   Ú<module>   s   