| Server IP : 118.27.122.248 / Your IP : 216.73.216.230 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/test/__pycache__/ |
Upload File : |
3
�w2_� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlmZmZ d dlm Z dd� Z
dd� ZG dd � d e�Z
G d
d� dej�Zedkr�ej� dS )
� N)�loads�dumps)�supportc C s t | d�rtj| �S td��dS )z�
Helper function to convert a slice argument to an integer, and raise
TypeError with a suitable message on failure.
� __index__zBslice indices must be integers or None or have an __index__ methodN)�hasattr�operator�index� TypeError)�arg� r �4/opt/alt/python36/lib64/python3.6/test/test_slice.py�evaluate_slice_index
s
r
c C s� t j|�}| jdkrdnt| j�}|dk r2td��|dkrBtd��|dk rNdnd}|dk rb|d n|}| jdkr�|dk r||n|}n*t| j�}|dk r�t|| |�nt||�}| jdkr�|dk r�|n|}n*t| j�}|dk r�t|| |�nt||�}|||fS )zA
Reference implementation for the slice.indices method.
N� r zlength should not be negativezslice step cannot be zero���) r r �stepr
�
ValueError�start�max�min�stop)�slice�lengthr �lower�upperr r r r r �
slice_indices s"