| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.10/test/__pycache__/ |
Upload File : |
o
�9j�$ � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ d dl m
Z
dd� Zdd� ZG dd � d e
�ZG d
d� dej�ZedkrIe�� dS dS )
� N)�loads�dumps)�supportc C s t | d�r
t�| �S td��)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__ method)�hasattr�operator�index� TypeError)�arg� r �&/usr/lib/python3.10/test/test_slice.py�evaluate_slice_index s
�r
c C s� t �|�}| jdu rdnt| j�}|dk rtd��|dkr!td��|dk r'dnd}|dk r1|d n|}| jdu rA|dk r>|n|}nt| j�}|dk rQt|| |�nt||�}| jdu rd|dk ra|n|}nt| j�}|dk rtt|| |�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"