Your IP : 216.73.216.213
B
Z��ZN � @ s� d dl mZ ddlmZmZmZ d dlZdd� Zejdd� �Z d.d
d�Z
ejdd
� �Zdd� Z
dd� Zejdd� �Zdd� Zdd� Zdd� Zdd� Zdd� Zejd/dd��Zejd d!� �Zd"d#� Zejd$d%� �Zd&d'� Zejd(d)� �Zd*d+� Zd,d-� ZdS )0� )�absolute_import� )�CType�CTypedefType�CStructOrUnionTypeNc C s: x4| d k r4t | dd �}|r,| j�dd�r,dS | j} qW d S )N�
directivesZ
np_pythranFT)�getattrr �getZouter_scope)�envr � r �J/opt/alt/python37/lib64/python3.7/site-packages/Cython/Compiler/Pythran.py�has_np_pythran s
r
c C s t | t�rt| j�S | jS )N)�
isinstancer �is_pythran_supported_typeZtypedef_base_type�
is_numeric)�type_r r r �is_pythran_supported_dtype s
r �ndarrayc C s� | j rf| j| j }}t|t�r&|j}n2t|t�r:|�� }nt|t�rL|j }nt
d| ��d|||f S | jrr| jS | j
r�| �� S t
d| t| �f ��d S )Nzunsupported type %s!zpythonic::types::%s<%s,%d>z unsupported pythran type %s (%s))Z is_buffer�ndim�dtyper r Zcnamer �
sign_and_namer Z
typedef_cname�
ValueError�is_pythran_expr�pythran_typer �type)ZTy�ptyper r �ctyper r r r s
r c C s d| S )Nz(typename std::remove_reference<%s>::typer )�tyr r r �type_remove_ref0 s r c C s dt |�| t |�f S )Nz2decltype(std::declval<%s>() %s std::declval<%s>()))r )�opZtAZtBr r r �pythran_binop_type5 s r c C s d| t |�f S )Nzdecltype(%sstd::declval<%s>()))r )r r r r r �pythran_unaryop_type: s r! c s0 d� � fdd�|D ��}t|�dkr(dnd| S )N�,c s g | ]}� |��qS r r )�.0�idx)�
index_coder r �
<listcomp>A s z!_index_access.<locals>.<listcomp>r z[%s]z(%s))�join�len)r% �indicesZindexingr )r% r �
_index_access? s r* c C sr | \}}|j r@|jjr d}d}nd}d}d|d�dg| �f S |jrRd|�� S |jrbd|j S td | ��d S )
N�contiguous_slice� �slice� zpythonic::types::%s(%s)r"