← Back
Editing: type_check.cpython-311.pyc
� ���c�M � � � d Z ddlZddlZg d�Zddlmc mZ ddlmZm Z m Z mZ ddlm Z ddlmZ ddlmZmZ ej ej d � � � ZdZ e d � � dNd�� � ZdOd�Z ee� � ej fd�� � Zd� Z ee� � d� � � Zd� Z ee� � d� � � Zd� Z ee� � d� � � Z ee� � d� � � Z ee� � d� � � Z! ee� � d� � � Z"d� Z#dPd�Z$ ee$� � dQd�� � Z%dOd�Z& ee&� � dRd!�� � Z'i d"d#�d$d%�d&d'�d(d)�d*d+�d,d-�d.d/�d0d1�d2d3�d4d5�d6d7�d8d9�d:d;�d d<�d=d>�d?d@�dAdB�dCdDdEdFdGdH��Z( e d � � dI� � � Z)ej* ej+ ej, ej- gdej. ej/ ej0 ggZ1ej* dej+ dej, dJej- dKej. dej/ dJej0 dKiZ2dL� Z3 ee3� � dM� � � Z4dS )Sz@Automatically adapted for numpy Sep 19, 2005 by convertcode.py � N)�iscomplexobj� isrealobj�imag� iscomplex�isreal� nan_to_num�real� real_if_close�typename�asfarray�mintypecode�common_type)�asarray� asanyarray�isnan�zeros)� set_module)� overrides� )�isneginf�isposinf�numpy)�modulezGDFgdfQqLlIiHhBb?�GDFgdf�dc � �� d� | D � � }t �fd�|D � � � � }|s|S d|v rd|v rdS t |t j �� � S )a� Return the character for the minimum-size type to which given types can be safely cast. The returned type character must represent the smallest size dtype such that an array of the returned type can handle the data from an array of all types in `typechars` (or if `typechars` is an array, then its dtype.char). Parameters ---------- typechars : list of str or array_like If a list of strings, each string should represent a dtype. If array_like, the character representation of the array dtype is used. typeset : str or list of str, optional The set of characters that the returned character is chosen from. The default set is 'GDFgdf'. default : str, optional The default character, this is returned if none of the characters in `typechars` matches a character in `typeset`. Returns ------- typechar : str The character representing the minimum-size type that was found. See Also -------- dtype, sctype2char, maximum_sctype Examples -------- >>> np.mintypecode(['d', 'f', 'S']) 'd' >>> x = np.array([1.1, 2-3.j]) >>> np.mintypecode(x) 'D' >>> np.mintypecode('abceh', default='G') 'G' c 3 �v K � | ]4}t |t � � r|pt |� � j j V � �5d S �N)� isinstance�strr �dtype�char)�.0�ts �6/usr/lib/python3/dist-packages/numpy/lib/type_check.py� <genexpr>zmintypecode.<locals>.<genexpr>F sV � � � � %� %�� �Q��$�$�*��D�w�q�z�z�/?�/D� %� %� %� %� %� %� c 3 �$ �K � | ] }|�v �|V � �d S r � )r# r$ �typesets �r% r&