| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/sphinx/ext/napoleon/__pycache__/ |
Upload File : |
a
�ab� � @ sB d Z ddlZddlmZmZmZ G dd� d�ZG dd� de�ZdS )z�
sphinx.ext.napoleon.iterators
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A collection of helpful iterators.
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)�Any�Iterable�Optionalc @ s� e Zd ZdZedd�dd�Zd d�dd�Zdeed �d
d�Ze e dd �dd
�Z
ed�dd�Zdeed �dd�Z
de e ed �dd�ZdS )� peek_iteral An iterator object that supports peeking ahead.
Parameters
----------
o : iterable or callable
`o` is interpreted very differently depending on the presence of
`sentinel`.
If `sentinel` is not given, then `o` must be a collection object
which supports either the iteration protocol or the sequence protocol.
If `sentinel` is given, then `o` must be a callable object.
sentinel : any value, optional
If given, the iterator will call `o` with no arguments for each
call to its `next` method; if the value returned is equal to
`sentinel`, :exc:`StopIteration` will be raised, otherwise the
value will be returned.
See Also
--------
`peek_iter` can operate as a drop in replacement for the built-in
`iter <https://docs.python.org/3/library/functions.html#iter>`_ function.
Attributes
----------
sentinel
The value used to indicate the iterator is exhausted. If `sentinel`
was not given when the `peek_iter` was instantiated, then it will
be set to a new object instance: ``object()``.
N)�args�returnc G s8 t |� | _t�� | _t|�dkr,|d | _nt� | _dS )z__init__(o, sentinel=None)� � N)�iter� _iterable�collections�deque�_cache�len�sentinel�object)�selfr � r �A/usr/lib/python3.9/site-packages/sphinx/ext/napoleon/iterators.py�__init__2 s
zpeek_iter.__init__)r c C s | S �Nr �r r r r �__iter__; s zpeek_iter.__iter__��nr c C s
| � |�S r )�next�r r r r r �__next__>