chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
db952c3f-cdd6-4ded-bb8d-c58c20554c1c | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,895 | supabase-export-v2 | f4636850eaf06976 | 1. any value in ``time.tzname`` for your machine's locale 2. the hard-coded values ``UTC`` and ``GMT``
So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as
valid values, but probably not ``EST``. It will raise ``ValueError`` for
invalid values. | trusted_official_docs | CPython Docs | 1. any value in ``time.tzname`` for your machine's locale 2. the hard-coded values ``UTC`` and ``GMT``
So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as
valid values, but probably not ``EST``. It will raise ``ValueError`` for
invalid values. | 1. any value in ``time.tzname`` for your machine's locale 2. the hard-coded values ``UTC`` and ``GMT``
So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as
valid values, but probably not ``EST``. It will raise ``ValueError`` for
invalid values. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dd05adc8-9fa1-4b9d-9dfe-8205c35796f6 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,836 | supabase-export-v2 | 5881d71241fd2c25 | These methods accept format codes that can be used to parse and format dates::
>>> import datetime as dt
>>> dt.datetime.strptime('31/01/22 23:59:59.999999',
... '%d/%m/%y %H:%M:%S.%f')
datetime.datetime(2022, 1, 31, 23, 59, 59, 999999)
>>> _.strftime('%a %d %b %Y, %I:%M%p')
'Mon 31 Jan 2022, 11:59PM' | trusted_official_docs | CPython Docs | These methods accept format codes that can be used to parse and format dates::
>>> import datetime as dt
>>> dt.datetime.strptime('31/01/22 23:59:59.999999',
... '%d/%m/%y %H:%M:%S.%f')
datetime.datetime(2022, 1, 31, 23, 59, 59, 999999)
>>> _.strftime('%a %d %b %Y, %I:%M%p')
'Mon 31 Jan 2022, 11:59PM' | These methods accept format codes that can be used to parse and format dates::
>>> import datetime as dt
>>> dt.datetime.strptime('31/01/22 23:59:59.999999',
... '%d/%m/%y %H:%M:%S.%f')
datetime.datetime(2022, 1, 31, 23, 59, 59, 999999)
>>> _.strftime('%a %d %b %Y, %I:%M%p')
'Mon 31 Jan 2022, 11:59PM' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
decfacc9-4fc9-480a-b5f6-7c1dd1879c7c | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,720 | supabase-export-v2 | 85ac3ab6768ca440 | ``HH:MM:SS``, if :attr:`microsecond` is 0 - ``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None`` - ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:`utcoffset` does not return ``None``
The optional argument *timespec* specifies the number of additional
component... | trusted_official_docs | CPython Docs | ``HH:MM:SS``, if :attr:`microsecond` is 0 - ``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None`` - ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:`utcoffset` does not return ``None``
The optional argument *timespec* specifies the number of additional
component... | ``HH:MM:SS``, if :attr:`microsecond` is 0 - ``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None`` - ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:`utcoffset` does not return ``None``
The optional argument *timespec* specifies the number of additional
component... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
defc00fc-9f82-46be-8175-074fcd7b17b7 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,632 | supabase-export-v2 | 3072eef0b6374e52 | offset.""" ... def utcoffset(self, when): ... return dt.timedelta(hours=-6, minutes=-39) ... >>> dt.datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ') '2002-12-25 00:00:00-06:39' >>> dt.datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat() '2009-11-27T00:00:00.000100-06:39'
The optional argument *timespec* s... | trusted_official_docs | CPython Docs | offset.""" ... def utcoffset(self, when): ... return dt.timedelta(hours=-6, minutes=-39) ... >>> dt.datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ') '2002-12-25 00:00:00-06:39' >>> dt.datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat() '2009-11-27T00:00:00.000100-06:39'
The optional argument *timespec* s... | offset.""" ... def utcoffset(self, when): ... return dt.timedelta(hours=-6, minutes=-39) ... >>> dt.datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ') '2002-12-25 00:00:00-06:39' >>> dt.datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat() '2009-11-27T00:00:00.000100-06:39'
The optional argument *timespec* s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
df9523da-49e9-4303-8884-b85f9a0902a2 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,664 | supabase-export-v2 | 1ff57f2e504ef346 | class KabulTz(dt.tzinfo): # Kabul used +4 until 1945, when they moved to +4:30 UTC_MOVE_DATE = dt.datetime(1944, 12, 31, 20, tzinfo=dt.timezone.utc)
def utcoffset(self, when):
if when.year < 1945:
return dt.timedelta(hours=4)
elif (1945, 1, 1, 0, 0) <= when.timetuple()[:5] < (1945, 1, 1, 0, 30):
# An ambiguous ("im... | trusted_official_docs | CPython Docs | class KabulTz(dt.tzinfo): # Kabul used +4 until 1945, when they moved to +4:30 UTC_MOVE_DATE = dt.datetime(1944, 12, 31, 20, tzinfo=dt.timezone.utc)
def utcoffset(self, when):
if when.year < 1945:
return dt.timedelta(hours=4)
elif (1945, 1, 1, 0, 0) <= when.timetuple()[:5] < (1945, 1, 1, 0, 30):
# An ambiguous ("im... | class KabulTz(dt.tzinfo): # Kabul used +4 until 1945, when they moved to +4:30 UTC_MOVE_DATE = dt.datetime(1944, 12, 31, 20, tzinfo=dt.timezone.utc)
def utcoffset(self, when):
if when.year < 1945:
return dt.timedelta(hours=4)
elif (1945, 1, 1, 0, 0) <= when.timetuple()[:5] < (1945, 1, 1, 0, 30):
# An ambiguous ("im... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dfa402f5-c644-4984-9f14-e406eddce662 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,748 | supabase-export-v2 | 6e54e7255a578e2d | .. class:: tzinfo()
This is an :term:`abstract base class`, meaning that this class should not be
instantiated directly. Define a subclass of :class:`tzinfo` to capture
information about a particular time zone. | trusted_official_docs | CPython Docs | .. class:: tzinfo()
This is an :term:`abstract base class`, meaning that this class should not be
instantiated directly. Define a subclass of :class:`tzinfo` to capture
information about a particular time zone. | .. class:: tzinfo()
This is an :term:`abstract base class`, meaning that this class should not be
instantiated directly. Define a subclass of :class:`tzinfo` to capture
information about a particular time zone. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e068fa78-adf6-4fd7-8ed4-1df5aeff94af | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,505 | supabase-export-v2 | fecbd320937fcfec | .. classmethod:: datetime.combine(date, time, tzinfo=time.tzinfo)
Return a new :class:`.datetime` object whose date components are equal to the
given :class:`date` object's, and whose time components
are equal to the given :class:`.time` object's. If the *tzinfo*
argument is provided, its value is used to set the :a... | trusted_official_docs | CPython Docs | .. classmethod:: datetime.combine(date, time, tzinfo=time.tzinfo)
Return a new :class:`.datetime` object whose date components are equal to the
given :class:`date` object's, and whose time components
are equal to the given :class:`.time` object's. If the *tzinfo*
argument is provided, its value is used to set the :a... | .. classmethod:: datetime.combine(date, time, tzinfo=time.tzinfo)
Return a new :class:`.datetime` object whose date components are equal to the
given :class:`date` object's, and whose time components
are equal to the given :class:`.time` object's. If the *tzinfo*
argument is provided, its value is used to set the :a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e08b2cce-166d-47a9-882e-e402a9600c4a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,599 | supabase-export-v2 | 480a65c61f414286 | the same as ``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what ``d.dst()`` returns. DST is never in effect for a UTC time.
If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting
``d.utcoffset()``, and a :class:`time.struct_time` for the
normalized time is r... | trusted_official_docs | CPython Docs | the same as ``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what ``d.dst()`` returns. DST is never in effect for a UTC time.
If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting
``d.utcoffset()``, and a :class:`time.struct_time` for the
normalized time is r... | the same as ``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what ``d.dst()`` returns. DST is never in effect for a UTC time.
If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting
``d.utcoffset()``, and a :class:`time.struct_time` for the
normalized time is r... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e0e319b2-56f3-4811-a290-db3b5d1fc6c6 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,571 | supabase-export-v2 | 1d065ed6dd220151 | .. method:: datetime.replace(year=self.year, month=self.month, day=self.day, \ hour=self.hour, minute=self.minute, second=self.second, microsecond=self.microsecond, \ tzinfo=self.tzinfo, *, fold=0)
Return a new :class:`datetime` object with the same attributes, but with
specified parameters updated. Note that ``tzinfo... | trusted_official_docs | CPython Docs | .. method:: datetime.replace(year=self.year, month=self.month, day=self.day, \ hour=self.hour, minute=self.minute, second=self.second, microsecond=self.microsecond, \ tzinfo=self.tzinfo, *, fold=0)
Return a new :class:`datetime` object with the same attributes, but with
specified parameters updated. Note that ``tzinfo... | .. method:: datetime.replace(year=self.year, month=self.month, day=self.day, \ hour=self.hour, minute=self.minute, second=self.second, microsecond=self.microsecond, \ tzinfo=self.tzinfo, *, fold=0)
Return a new :class:`datetime` object with the same attributes, but with
specified parameters updated. Note that ``tzinfo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e2a663b0-c786-4bee-b2c3-17df1cf775bc | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,230 | supabase-export-v2 | 63a3b43ff5f5a9ac | object can locate itself relative to other aware objects. An aware object represents a specific moment in time that is not open to interpretation. [#]_
A **naive** object does not contain enough information to unambiguously locate
itself relative to other date/time objects. Whether a naive object represents
Coordinated... | trusted_official_docs | CPython Docs | object can locate itself relative to other aware objects. An aware object represents a specific moment in time that is not open to interpretation. [#]_
A **naive** object does not contain enough information to unambiguously locate
itself relative to other date/time objects. Whether a naive object represents
Coordinated... | object can locate itself relative to other aware objects. An aware object represents a specific moment in time that is not open to interpretation. [#]_
A **naive** object does not contain enough information to unambiguously locate
itself relative to other date/time objects. Whether a naive object represents
Coordinated... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e32acff3-7e47-4ef7-95c9-79367aa75fa6 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,849 | supabase-export-v2 | f8a448cfb9b6da41 | | | new year preceding the first | | | | | Sunday are considered to be in | | | | | week 0.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%V`` | ISO 8601 week as a decimal | 01, 02, ..., 53 | \(8), |
| | number with Monday as | | \(9) |
| | the first day of the week. | | |
| ... | trusted_official_docs | CPython Docs | | | new year preceding the first | | | | | Sunday are considered to be in | | | | | week 0.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%V`` | ISO 8601 week as a decimal | 01, 02, ..., 53 | \(8), |
| | number with Monday as | | \(9) |
| | the first day of the week. | | |
| ... | | | new year preceding the first | | | | | Sunday are considered to be in | | | | | week 0.
| | |
+-----------+--------------------------------+------------------------+-------+
| ``%V`` | ISO 8601 week as a decimal | 01, 02, ..., 53 | \(8), |
| | number with Monday as | | \(9) |
| | the first day of the week. | | |
| ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e44faee1-f197-4a42-bac6-c2b538a837ec | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,796 | supabase-export-v2 | 88e88532832fccaa | :attr:`~.datetime.fold` attribute set to 0 and the later times have it set to 1. For example, at the Fall back transition of 2016, we get::
>>> import datetime as dt
>>> from tzinfo_examples import HOUR, Eastern
>>> u0 = dt.datetime(2016, 11, 6, 4, tzinfo=dt.timezone.utc)
>>> for i in range(4):
... u = u0 + i*HOUR
... | trusted_official_docs | CPython Docs | :attr:`~.datetime.fold` attribute set to 0 and the later times have it set to 1. For example, at the Fall back transition of 2016, we get::
>>> import datetime as dt
>>> from tzinfo_examples import HOUR, Eastern
>>> u0 = dt.datetime(2016, 11, 6, 4, tzinfo=dt.timezone.utc)
>>> for i in range(4):
... u = u0 + i*HOUR
... | :attr:`~.datetime.fold` attribute set to 0 and the later times have it set to 1. For example, at the Fall back transition of 2016, we get::
>>> import datetime as dt
>>> from tzinfo_examples import HOUR, Eastern
>>> u0 = dt.datetime(2016, 11, 6, 4, tzinfo=dt.timezone.utc)
>>> for i in range(4):
... u = u0 + i*HOUR
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e4665a4e-f98f-43df-85d9-2970eacfad67 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,897 | supabase-export-v2 | cb42f581fd2bf652 | is provided to the :meth:`~.datetime.strptime` method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` of the result will be set to a :class:`timezone` instance.
(7)
When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are only used
in calculations when the day of the week and ... | trusted_official_docs | CPython Docs | is provided to the :meth:`~.datetime.strptime` method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` of the result will be set to a :class:`timezone` instance.
(7)
When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are only used
in calculations when the day of the week and ... | is provided to the :meth:`~.datetime.strptime` method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` of the result will be set to a :class:`timezone` instance.
(7)
When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are only used
in calculations when the day of the week and ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e4a955f3-29a4-46a7-aa7d-fc9a8ae41491 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,679 | supabase-export-v2 | e6cd2d52c40d1632 | All arguments are optional. *tzinfo* may be ``None``, or an instance of a :class:`tzinfo` subclass. The remaining arguments must be integers in the following ranges:
* ``0 <= hour < 24``,
* ``0 <= minute < 60``,
* ``0 <= second < 60``,
* ``0 <= microsecond < 1000000``,
* ``fold in [0, 1]``. | trusted_official_docs | CPython Docs | All arguments are optional. *tzinfo* may be ``None``, or an instance of a :class:`tzinfo` subclass. The remaining arguments must be integers in the following ranges:
* ``0 <= hour < 24``,
* ``0 <= minute < 60``,
* ``0 <= second < 60``,
* ``0 <= microsecond < 1000000``,
* ``fold in [0, 1]``. | All arguments are optional. *tzinfo* may be ``None``, or an instance of a :class:`tzinfo` subclass. The remaining arguments must be integers in the following ranges:
* ``0 <= hour < 24``,
* ``0 <= minute < 60``,
* ``0 <= second < 60``,
* ``0 <= microsecond < 1000000``,
* ``fold in [0, 1]``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e531957c-9102-48bd-b73d-c97333334561 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,864 | supabase-export-v2 | dceb2b551ed86246 | :meth:`.datetime.strptime` and :meth:`.date.strptime` class methods, the default value is ``1900-01-01T00:00:00.000``: any components not specified in the format string will be pulled from the default value.
.. note::
Format strings without separators can be ambiguous for parsing. For
example, with ``%Y%m%d``, the st... | trusted_official_docs | CPython Docs | :meth:`.datetime.strptime` and :meth:`.date.strptime` class methods, the default value is ``1900-01-01T00:00:00.000``: any components not specified in the format string will be pulled from the default value.
.. note::
Format strings without separators can be ambiguous for parsing. For
example, with ``%Y%m%d``, the st... | :meth:`.datetime.strptime` and :meth:`.date.strptime` class methods, the default value is ``1900-01-01T00:00:00.000``: any components not specified in the format string will be pulled from the default value.
.. note::
Format strings without separators can be ambiguous for parsing. For
example, with ``%Y%m%d``, the st... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e55a630c-7ab2-4003-a1f8-ee5757a2748f | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,550 | supabase-export-v2 | 5c1ffb7eb2bd36cf | would be smaller than :const:`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time zone adjustments are done even if the input is an aware object.
(2)
Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. As for
addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the... | trusted_official_docs | CPython Docs | would be smaller than :const:`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time zone adjustments are done even if the input is an aware object.
(2)
Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. As for
addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the... | would be smaller than :const:`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time zone adjustments are done even if the input is an aware object.
(2)
Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. As for
addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e5bb9599-db6f-4cab-ad42-c672dc308463 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,321 | supabase-export-v2 | 8b2205aafcd1df68 | (5) String representations of :class:`timedelta` objects are normalized similarly to their internal representation. This leads to somewhat unusual results for negative timedeltas. For example::
>>> timedelta(hours=-5)
datetime.timedelta(days=-1, seconds=68400)
>>> print(_)
-1 day, 19:00:00 | trusted_official_docs | CPython Docs | (5) String representations of :class:`timedelta` objects are normalized similarly to their internal representation. This leads to somewhat unusual results for negative timedeltas. For example::
>>> timedelta(hours=-5)
datetime.timedelta(days=-1, seconds=68400)
>>> print(_)
-1 day, 19:00:00 | (5) String representations of :class:`timedelta` objects are normalized similarly to their internal representation. This leads to somewhat unusual results for negative timedeltas. For example::
>>> timedelta(hours=-5)
datetime.timedelta(days=-1, seconds=68400)
>>> print(_)
-1 day, 19:00:00 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e6865140-c0a5-49a8-a0fa-c8d158145440 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,389 | supabase-export-v2 | 40cfefab1dfda17f | | after ``date1``. (1) | +-------------------------------+----------------------------------------------+ | ``date2 = date1 - timedelta`` | Computes ``date2`` such that ``date2 + | | | timedelta == date1``.
(2) |
+-------------------------------+----------------------------------------------+
| ``timedelta = date1 - da... | trusted_official_docs | CPython Docs | | after ``date1``. (1) | +-------------------------------+----------------------------------------------+ | ``date2 = date1 - timedelta`` | Computes ``date2`` such that ``date2 + | | | timedelta == date1``.
(2) |
+-------------------------------+----------------------------------------------+
| ``timedelta = date1 - da... | | after ``date1``. (1) | +-------------------------------+----------------------------------------------+ | ``date2 = date1 - timedelta`` | Computes ``date2`` such that ``date2 + | | | timedelta == date1``.
(2) |
+-------------------------------+----------------------------------------------+
| ``timedelta = date1 - da... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e769fc43-c8a0-45a5-89e0-2c2b58ec4ccd | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,630 | supabase-export-v2 | add62121b729ca99 | >>> import datetime as dt >>> dt.datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat() '2019-05-18T15:17:08.132263' >>> dt.datetime(2019, 5, 18, 15, 17, tzinfo=dt.timezone.utc).isoformat() '2019-05-18T15:17:00+00:00'
The optional argument *sep* (default ``'T'``) is a one-character separator,
placed between the date and... | trusted_official_docs | CPython Docs | >>> import datetime as dt >>> dt.datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat() '2019-05-18T15:17:08.132263' >>> dt.datetime(2019, 5, 18, 15, 17, tzinfo=dt.timezone.utc).isoformat() '2019-05-18T15:17:00+00:00'
The optional argument *sep* (default ``'T'``) is a one-character separator,
placed between the date and... | >>> import datetime as dt >>> dt.datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat() '2019-05-18T15:17:08.132263' >>> dt.datetime(2019, 5, 18, 15, 17, tzinfo=dt.timezone.utc).isoformat() '2019-05-18T15:17:00+00:00'
The optional argument *sep* (default ``'T'``) is a one-character separator,
placed between the date and... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e7c0a02d-d89a-4997-90ea-0f2fa0d4b5ff | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,616 | supabase-export-v2 | 9dbba5651c53c0cb | .. versionchanged:: 3.6 The :meth:`timestamp` method uses the :attr:`.fold` attribute to disambiguate the times during a repeated interval.
.. versionchanged:: 3.6
This method no longer relies on the platform C :c:func:`mktime`
function to perform conversions. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.6 The :meth:`timestamp` method uses the :attr:`.fold` attribute to disambiguate the times during a repeated interval.
.. versionchanged:: 3.6
This method no longer relies on the platform C :c:func:`mktime`
function to perform conversions. | .. versionchanged:: 3.6 The :meth:`timestamp` method uses the :attr:`.fold` attribute to disambiguate the times during a repeated interval.
.. versionchanged:: 3.6
This method no longer relies on the platform C :c:func:`mktime`
function to perform conversions. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e9708452-7e32-4483-bc5e-894f2a902c24 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,320 | supabase-export-v2 | fa215fbb324addc4 | (4) ``-timedelta.max`` is not representable as a :class:`timedelta` object.
(5)
String representations of :class:`timedelta` objects are normalized
similarly to their internal representation. This leads to somewhat
unusual results for negative timedeltas. For example:: | trusted_official_docs | CPython Docs | (4) ``-timedelta.max`` is not representable as a :class:`timedelta` object.
(5)
String representations of :class:`timedelta` objects are normalized
similarly to their internal representation. This leads to somewhat
unusual results for negative timedeltas. For example:: | (4) ``-timedelta.max`` is not representable as a :class:`timedelta` object.
(5)
String representations of :class:`timedelta` objects are normalized
similarly to their internal representation. This leads to somewhat
unusual results for negative timedeltas. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ea129798-0e2f-4110-b5c6-6d6f077a23e4 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,395 | supabase-export-v2 | c42358599cfc1b5b | (3) This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta.microseconds`` are 0, and ``date2 + timedelta == date1`` after.
(4)
:class:`date` objects are equal if they represent the same date. | trusted_official_docs | CPython Docs | (3) This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta.microseconds`` are 0, and ``date2 + timedelta == date1`` after.
(4)
:class:`date` objects are equal if they represent the same date. | (3) This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta.microseconds`` are 0, and ``date2 + timedelta == date1`` after.
(4)
:class:`date` objects are equal if they represent the same date. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ea41e305-3f75-4d42-9992-19968a701bb4 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,779 | supabase-export-v2 | 66e6a0b0165ea47f | protocols. It may be more useful for ``utcoffset(None)`` to return the standard UTC offset, as there is no other convention for discovering the standard offset.
When a :class:`.datetime` object is passed in response to a :class:`!datetime`
method, ``dt.tzinfo`` is the same object as *self*. :class:`tzinfo` methods can
... | trusted_official_docs | CPython Docs | protocols. It may be more useful for ``utcoffset(None)`` to return the standard UTC offset, as there is no other convention for discovering the standard offset.
When a :class:`.datetime` object is passed in response to a :class:`!datetime`
method, ``dt.tzinfo`` is the same object as *self*. :class:`tzinfo` methods can
... | protocols. It may be more useful for ``utcoffset(None)`` to return the standard UTC offset, as there is no other convention for discovering the standard offset.
When a :class:`.datetime` object is passed in response to a :class:`!datetime`
method, ``dt.tzinfo`` is the same object as *self*. :class:`tzinfo` methods can
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb469864-aa54-46f5-9fd2-b74f9d74eff5 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,857 | supabase-export-v2 | 1b8bfc3b841e407e | | -03:07:12.345216 | | +-----------+--------------------------------+------------------------+-------+
The full set of format codes supported varies across platforms, because Python
calls the platform C library's :c:func:`strftime` function, and platform
variations are common. To see the full set of format codes suppor... | trusted_official_docs | CPython Docs | | -03:07:12.345216 | | +-----------+--------------------------------+------------------------+-------+
The full set of format codes supported varies across platforms, because Python
calls the platform C library's :c:func:`strftime` function, and platform
variations are common. To see the full set of format codes suppor... | | -03:07:12.345216 | | +-----------+--------------------------------+------------------------+-------+
The full set of format codes supported varies across platforms, because Python
calls the platform C library's :c:func:`strftime` function, and platform
variations are common. To see the full set of format codes suppor... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ec616236-ee6f-4854-b2c0-d681ffa3a044 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,232 | supabase-export-v2 | ed75fbb1bf27194e | :class:`!tzinfo` class. These :class:`tzinfo` objects capture information about the offset from UTC time, the time zone name, and whether daylight saving time is in effect.
Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is
supplied by the :mod:`!datetime` module. The :class:`!timezone` class can
... | trusted_official_docs | CPython Docs | :class:`!tzinfo` class. These :class:`tzinfo` objects capture information about the offset from UTC time, the time zone name, and whether daylight saving time is in effect.
Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is
supplied by the :mod:`!datetime` module. The :class:`!timezone` class can
... | :class:`!tzinfo` class. These :class:`tzinfo` objects capture information about the offset from UTC time, the time zone name, and whether daylight saving time is in effect.
Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is
supplied by the :mod:`!datetime` module. The :class:`!timezone` class can
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ecdbc846-0490-48d9-be59-c95e18639a85 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,660 | supabase-export-v2 | 27e495076dba233e | = my_datetime.isocalendar() >>> for it in ic: # doctest: +SKIP ... print(it) ... 2006 # ISO year 47 # ISO week 2 # ISO weekday
>>> # Formatting a datetime
>>> my_datetime.strftime("%A, %d. %B %Y %I:%M%p")
'Tuesday, 21. November 2006 04:30PM'
>>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'.format(... | trusted_official_docs | CPython Docs | = my_datetime.isocalendar() >>> for it in ic: # doctest: +SKIP ... print(it) ... 2006 # ISO year 47 # ISO week 2 # ISO weekday
>>> # Formatting a datetime
>>> my_datetime.strftime("%A, %d. %B %Y %I:%M%p")
'Tuesday, 21. November 2006 04:30PM'
>>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'.format(... | = my_datetime.isocalendar() >>> for it in ic: # doctest: +SKIP ... print(it) ... 2006 # ISO year 47 # ISO week 2 # ISO weekday
>>> # Formatting a datetime
>>> my_datetime.strftime("%A, %d. %B %Y %I:%M%p")
'Tuesday, 21. November 2006 04:30PM'
>>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'.format(... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ed0d3ea6-7d2b-4457-aa41-6a9386ad6722 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,577 | supabase-export-v2 | ec3f09f07905aed3 | and its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If *self* is naive, it is presumed to represent time in the system time zone.
If called without arguments (or with ``tz=None``) the system local
time zone is assumed for the target time zone. The ``.tzinfo`` attribute of the converted
datetim... | trusted_official_docs | CPython Docs | and its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If *self* is naive, it is presumed to represent time in the system time zone.
If called without arguments (or with ``tz=None``) the system local
time zone is assumed for the target time zone. The ``.tzinfo`` attribute of the converted
datetim... | and its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If *self* is naive, it is presumed to represent time in the system time zone.
If called without arguments (or with ``tz=None``) the system local
time zone is assumed for the target time zone. The ``.tzinfo`` attribute of the converted
datetim... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eddec595-52a3-4229-9394-383897c68af4 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,483 | supabase-export-v2 | db9d66b47c853ace | argument *tz* is ``None`` or not specified, the timestamp is converted to the platform's local date and time, and the returned :class:`.datetime` object is naive.
If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the
timestamp is converted to *tz*’s time zone. | trusted_official_docs | CPython Docs | argument *tz* is ``None`` or not specified, the timestamp is converted to the platform's local date and time, and the returned :class:`.datetime` object is naive.
If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the
timestamp is converted to *tz*’s time zone. | argument *tz* is ``None`` or not specified, the timestamp is converted to the platform's local date and time, and the returned :class:`.datetime` object is naive.
If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the
timestamp is converted to *tz*’s time zone. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
efc95196-0b3c-4a95-96ed-8ba8ef9c69ad | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,744 | supabase-export-v2 | e0231b239056d41c | Examples of working with a :class:`.time` object::
>>> import datetime as dt
>>> class TZ1(dt.tzinfo):
... def utcoffset(self, when):
... return dt.timedelta(hours=1)
... def dst(self, when):
... return dt.timedelta(0)
... def tzname(self, when):
... return "+01:00"
... def __repr__(self):
... return f"{self._... | trusted_official_docs | CPython Docs | Examples of working with a :class:`.time` object::
>>> import datetime as dt
>>> class TZ1(dt.tzinfo):
... def utcoffset(self, when):
... return dt.timedelta(hours=1)
... def dst(self, when):
... return dt.timedelta(0)
... def tzname(self, when):
... return "+01:00"
... def __repr__(self):
... return f"{self._... | Examples of working with a :class:`.time` object::
>>> import datetime as dt
>>> class TZ1(dt.tzinfo):
... def utcoffset(self, when):
... return dt.timedelta(hours=1)
... def dst(self, when):
... return dt.timedelta(0)
... def tzname(self, when):
... return "+01:00"
... def __repr__(self):
... return f"{self._... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f21f3cc2-93f3-4833-83bb-4d177368f4c7 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,545 | supabase-export-v2 | 4933be3e746dd7e4 | .. attribute:: datetime.fold
In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A
repeated interval occurs when clocks are rolled back at the end of daylight saving
time or when the UTC offset for the current zone is decreased for political reasons.)
The values 0 and 1 represent, respectivel... | trusted_official_docs | CPython Docs | .. attribute:: datetime.fold
In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A
repeated interval occurs when clocks are rolled back at the end of daylight saving
time or when the UTC offset for the current zone is decreased for political reasons.)
The values 0 and 1 represent, respectivel... | .. attribute:: datetime.fold
In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A
repeated interval occurs when clocks are rolled back at the end of daylight saving
time or when the UTC offset for the current zone is decreased for political reasons.)
The values 0 and 1 represent, respectivel... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f226e2f1-ac05-4f22-ba22-396861cbf765 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,576 | supabase-export-v2 | 9da576665ffa42b9 | new :attr:`.tzinfo` attribute *tz*, adjusting the date and time data so the result is the same UTC time as *self*, but in *tz*'s local time.
If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and its
:meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If *self*
is naive, it is presum... | trusted_official_docs | CPython Docs | new :attr:`.tzinfo` attribute *tz*, adjusting the date and time data so the result is the same UTC time as *self*, but in *tz*'s local time.
If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and its
:meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If *self*
is naive, it is presum... | new :attr:`.tzinfo` attribute *tz*, adjusting the date and time data so the result is the same UTC time as *self*, but in *tz*'s local time.
If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and its
:meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If *self*
is naive, it is presum... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f302973f-bf10-43a0-bfec-46bc5cf73bd7 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,644 | supabase-export-v2 | 5d042e43f79e4c36 | >>> import datetime as dt >>> dt.datetime(2002, 12, 4, 20, 30, 40).ctime() 'Wed Dec 4 20:30:40 2002'
The output string will *not* include time zone information, regardless
of whether the input is aware or naive. | trusted_official_docs | CPython Docs | >>> import datetime as dt >>> dt.datetime(2002, 12, 4, 20, 30, 40).ctime() 'Wed Dec 4 20:30:40 2002'
The output string will *not* include time zone information, regardless
of whether the input is aware or naive. | >>> import datetime as dt >>> dt.datetime(2002, 12, 4, 20, 30, 40).ctime() 'Wed Dec 4 20:30:40 2002'
The output string will *not* include time zone information, regardless
of whether the input is aware or naive. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f362a41c-ec37-431f-875b-8135d01de6f0 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,280 | supabase-export-v2 | 46b676e4ead357f8 | and days, seconds and microseconds are then normalized so that the representation is unique, with
* ``0 <= microseconds < 1000000``
* ``0 <= seconds < 3600*24`` (the number of seconds in one day)
* ``-999999999 <= days <= 999999999`` | trusted_official_docs | CPython Docs | and days, seconds and microseconds are then normalized so that the representation is unique, with
* ``0 <= microseconds < 1000000``
* ``0 <= seconds < 3600*24`` (the number of seconds in one day)
* ``-999999999 <= days <= 999999999`` | and days, seconds and microseconds are then normalized so that the representation is unique, with
* ``0 <= microseconds < 1000000``
* ``0 <= seconds < 3600*24`` (the number of seconds in one day)
* ``-999999999 <= days <= 999999999`` | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f3923e1b-5399-4453-af38-90c8f831bf9d | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,754 | supabase-export-v2 | b5d9f5e3e6cae259 | .. method:: tzinfo.utcoffset(dt)
Return offset of local time from UTC, as a :class:`timedelta` object that is
positive east of UTC. If local time is west of UTC, this should be negative. | trusted_official_docs | CPython Docs | .. method:: tzinfo.utcoffset(dt)
Return offset of local time from UTC, as a :class:`timedelta` object that is
positive east of UTC. If local time is west of UTC, this should be negative. | .. method:: tzinfo.utcoffset(dt)
Return offset of local time from UTC, as a :class:`timedelta` object that is
positive east of UTC. If local time is west of UTC, this should be negative. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f46743f3-8183-4878-b3e0-4646f850c280 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,396 | supabase-export-v2 | 80af9da1f70ce8f5 | (4) :class:`date` objects are equal if they represent the same date.
:class:`!date` objects that are not also :class:`.datetime` instances
are never equal to :class:`!datetime` objects, even if they represent
the same date. | trusted_official_docs | CPython Docs | (4) :class:`date` objects are equal if they represent the same date.
:class:`!date` objects that are not also :class:`.datetime` instances
are never equal to :class:`!datetime` objects, even if they represent
the same date. | (4) :class:`date` objects are equal if they represent the same date.
:class:`!date` objects that are not also :class:`.datetime` instances
are never equal to :class:`!datetime` objects, even if they represent
the same date. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f4b77739-bfc0-42cd-b597-8900d906a546 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,261 | supabase-export-v2 | a642d42c8e39fd92 | The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` types share these common features:
- Objects of these types are immutable. - Objects of these types are :term:`hashable`, meaning that they can be used as
dictionary keys. - Objects of these types support efficient pickling via the :mod:`pick... | trusted_official_docs | CPython Docs | The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` types share these common features:
- Objects of these types are immutable. - Objects of these types are :term:`hashable`, meaning that they can be used as
dictionary keys. - Objects of these types support efficient pickling via the :mod:`pick... | The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` types share these common features:
- Objects of these types are immutable. - Objects of these types are :term:`hashable`, meaning that they can be used as
dictionary keys. - Objects of these types support efficient pickling via the :mod:`pick... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f4f02b4c-f4fc-4430-8b28-89e1b98e37e0 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,362 | supabase-export-v2 | 76c4a7493036bcbe | >>> import datetime as dt >>> dt.date.fromisoformat('2019-12-04') datetime.date(2019, 12, 4) >>> dt.date.fromisoformat('20191204') datetime.date(2019, 12, 4) >>> dt.date.fromisoformat('2021-W01-1') datetime.date(2021, 1, 4)
.. versionadded:: 3.7
.. versionchanged:: 3.11
Previously, this method only supported the form... | trusted_official_docs | CPython Docs | >>> import datetime as dt >>> dt.date.fromisoformat('2019-12-04') datetime.date(2019, 12, 4) >>> dt.date.fromisoformat('20191204') datetime.date(2019, 12, 4) >>> dt.date.fromisoformat('2021-W01-1') datetime.date(2021, 1, 4)
.. versionadded:: 3.7
.. versionchanged:: 3.11
Previously, this method only supported the form... | >>> import datetime as dt >>> dt.date.fromisoformat('2019-12-04') datetime.date(2019, 12, 4) >>> dt.date.fromisoformat('20191204') datetime.date(2019, 12, 4) >>> dt.date.fromisoformat('2021-W01-1') datetime.date(2021, 1, 4)
.. versionadded:: 3.7
.. versionchanged:: 3.11
Previously, this method only supported the form... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f58b5a76-3310-48f1-9d0c-306fa7f88a4e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,770 | supabase-export-v2 | 8c6d5f823e2d0e61 | import datetime as dt
def dst(self, when):
# Code to set dston and dstoff to the time zone's DST
# transition times based on the input when.year, and expressed
# in standard local time. | trusted_official_docs | CPython Docs | import datetime as dt
def dst(self, when):
# Code to set dston and dstoff to the time zone's DST
# transition times based on the input when.year, and expressed
# in standard local time. | import datetime as dt
def dst(self, when):
# Code to set dston and dstoff to the time zone's DST
# transition times based on the input when.year, and expressed
# in standard local time. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f6659415-f256-4aeb-9c55-8cdd9dd07698 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,490 | supabase-export-v2 | b984036a6add6df4 | Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, with :attr:`.tzinfo` ``None``. (The resulting object is naive.)
This may raise :exc:`OverflowError`, if the timestamp is
out of the range of values supported by the platform C :c:func:`gmtime` function,
and :exc:`OSError` on :c:func:`gmtime` fail... | trusted_official_docs | CPython Docs | Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, with :attr:`.tzinfo` ``None``. (The resulting object is naive.)
This may raise :exc:`OverflowError`, if the timestamp is
out of the range of values supported by the platform C :c:func:`gmtime` function,
and :exc:`OSError` on :c:func:`gmtime` fail... | Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, with :attr:`.tzinfo` ``None``. (The resulting object is naive.)
This may raise :exc:`OverflowError`, if the timestamp is
out of the range of values supported by the platform C :c:func:`gmtime` function,
and :exc:`OSError` on :c:func:`gmtime` fail... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f667d0b5-6659-4d7c-9199-02634bcd8b5e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,352 | supabase-export-v2 | 1ef597ffaa325af7 | from 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by :meth:`fromtimestamp`.
.. versionchanged:: 3.3
Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp
is out of the range of values supported by the platform C... | trusted_official_docs | CPython Docs | from 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by :meth:`fromtimestamp`.
.. versionchanged:: 3.3
Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp
is out of the range of values supported by the platform C... | from 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by :meth:`fromtimestamp`.
.. versionchanged:: 3.3
Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp
is out of the range of values supported by the platform C... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f6d08a92-e4f6-472a-8903-85625799196a | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,288 | supabase-export-v2 | a74b970f187315f9 | >>> import datetime as dt >>> d = dt.timedelta(microseconds=-1) >>> (d.days, d.seconds, d.microseconds) (-1, 86399, 999999)
Since the string representation of :class:`!timedelta` objects can be confusing,
use the following recipe to produce a more readable format: | trusted_official_docs | CPython Docs | >>> import datetime as dt >>> d = dt.timedelta(microseconds=-1) >>> (d.days, d.seconds, d.microseconds) (-1, 86399, 999999)
Since the string representation of :class:`!timedelta` objects can be confusing,
use the following recipe to produce a more readable format: | >>> import datetime as dt >>> d = dt.timedelta(microseconds=-1) >>> (d.days, d.seconds, d.microseconds) (-1, 86399, 999999)
Since the string representation of :class:`!timedelta` objects can be confusing,
use the following recipe to produce a more readable format: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f78aa19d-6869-4663-91a3-5c39f946d94f | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,422 | supabase-export-v2 | b171cf4da45c9281 | The ISO calendar is a widely used variant of the Gregorian calendar. [#]_
The ISO year consists of 52 or 53 full weeks, and where a week starts on a
Monday and ends on a Sunday. The first week of an ISO year is the first
(Gregorian) calendar week of a year containing a Thursday. This is called week
number 1, and the... | trusted_official_docs | CPython Docs | The ISO calendar is a widely used variant of the Gregorian calendar. [#]_
The ISO year consists of 52 or 53 full weeks, and where a week starts on a
Monday and ends on a Sunday. The first week of an ISO year is the first
(Gregorian) calendar week of a year containing a Thursday. This is called week
number 1, and the... | The ISO calendar is a widely used variant of the Gregorian calendar. [#]_
The ISO year consists of 52 or 53 full weeks, and where a week starts on a
Monday and ends on a Sunday. The first week of an ISO year is the first
(Gregorian) calendar week of a year containing a Thursday. This is called week
number 1, and the... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f822b61e-486e-4d04-988f-708c004757ac | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,777 | supabase-export-v2 | 56a9e0def60f70b4 | The default implementation of :meth:`tzname` raises :exc:`NotImplementedError`.
These methods are called by a :class:`.datetime` or :class:`.time` object, in
response to their methods of the same names. A :class:`!datetime` object passes
itself as the argument, and a :class:`!time` object passes ``None`` as the
argumen... | trusted_official_docs | CPython Docs | The default implementation of :meth:`tzname` raises :exc:`NotImplementedError`.
These methods are called by a :class:`.datetime` or :class:`.time` object, in
response to their methods of the same names. A :class:`!datetime` object passes
itself as the argument, and a :class:`!time` object passes ``None`` as the
argumen... | The default implementation of :meth:`tzname` raises :exc:`NotImplementedError`.
These methods are called by a :class:`.datetime` or :class:`.time` object, in
response to their methods of the same names. A :class:`!datetime` object passes
itself as the argument, and a :class:`!time` object passes ``None`` as the
argumen... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f957e512-1354-478a-96af-8a1822ef9636 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,705 | supabase-export-v2 | 0e359a4f8ec2ee46 | .. doctest::
>>> import datetime as dt
>>> dt.time.fromisoformat('04:23:01')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('T04:23:01')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('T042301')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('04:23:01.000384')
datetime.time(4, 23, 1, 384)
>>> dt.time.... | trusted_official_docs | CPython Docs | .. doctest::
>>> import datetime as dt
>>> dt.time.fromisoformat('04:23:01')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('T04:23:01')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('T042301')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('04:23:01.000384')
datetime.time(4, 23, 1, 384)
>>> dt.time.... | .. doctest::
>>> import datetime as dt
>>> dt.time.fromisoformat('04:23:01')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('T04:23:01')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('T042301')
datetime.time(4, 23, 1)
>>> dt.time.fromisoformat('04:23:01.000384')
datetime.time(4, 23, 1, 384)
>>> dt.time.... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fd591f88-8747-477b-90ca-92aecc33623d | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,559 | supabase-export-v2 | 1e020d9ab5fb70d8 | Order comparison between naive and aware :class:`.datetime` objects raises :exc:`TypeError`.
If both comparands are aware, and have the same :attr:`!tzinfo` attribute,
the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and
the base datetimes are compared. If both comparands are aware and have diff... | trusted_official_docs | CPython Docs | Order comparison between naive and aware :class:`.datetime` objects raises :exc:`TypeError`.
If both comparands are aware, and have the same :attr:`!tzinfo` attribute,
the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and
the base datetimes are compared. If both comparands are aware and have diff... | Order comparison between naive and aware :class:`.datetime` objects raises :exc:`TypeError`.
If both comparands are aware, and have the same :attr:`!tzinfo` attribute,
the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and
the base datetimes are compared. If both comparands are aware and have diff... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fe396629-962c-45a9-9b3c-c8a7665ba991 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,359 | supabase-export-v2 | 1214c99cdf19f2f7 | Return a :class:`date` corresponding to a *date_string* given in any valid ISO 8601 format, with the following exceptions:
1. Reduced precision dates are not currently supported (``YYYY-MM``,
``YYYY``). 2. Extended date representations are not currently supported
(``±YYYYYY-MM-DD``). 3. Ordinal dates are not currentl... | trusted_official_docs | CPython Docs | Return a :class:`date` corresponding to a *date_string* given in any valid ISO 8601 format, with the following exceptions:
1. Reduced precision dates are not currently supported (``YYYY-MM``,
``YYYY``). 2. Extended date representations are not currently supported
(``±YYYYYY-MM-DD``). 3. Ordinal dates are not currentl... | Return a :class:`date` corresponding to a *date_string* given in any valid ISO 8601 format, with the following exceptions:
1. Reduced precision dates are not currently supported (``YYYY-MM``,
``YYYY``). 2. Extended date representations are not currently supported
(``±YYYYYY-MM-DD``). 3. Ordinal dates are not currentl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fe5fd4a8-97d5-42d7-980f-02f180830b7e | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,908 | supabase-export-v2 | efbbdde8f76bebdc | Calculations*, where it's the base calendar for all computations. See the book for algorithms for converting between proleptic Gregorian ordinals and many other calendar systems.
.. [#] See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar
<https://web.archive.org/web/20220531051136/https://webspace.... | trusted_official_docs | CPython Docs | Calculations*, where it's the base calendar for all computations. See the book for algorithms for converting between proleptic Gregorian ordinals and many other calendar systems.
.. [#] See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar
<https://web.archive.org/web/20220531051136/https://webspace.... | Calculations*, where it's the base calendar for all computations. See the book for algorithms for converting between proleptic Gregorian ordinals and many other calendar systems.
.. [#] See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar
<https://web.archive.org/web/20220531051136/https://webspace.... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fe956069-4749-4dc3-bd0e-53e50dc10c68 | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,311 | supabase-export-v2 | a2e4758f6bcb04a6 | | | is true. (1) | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 * f or t1 = f * t2`` | Delta multiplied by a float.
The result is |
| | rounded to the nearest multiple of |
| | timedelta.resolution using round-half-to-even.|
+--------------------------------+-----------... | trusted_official_docs | CPython Docs | | | is true. (1) | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 * f or t1 = f * t2`` | Delta multiplied by a float.
The result is |
| | rounded to the nearest multiple of |
| | timedelta.resolution using round-half-to-even.|
+--------------------------------+-----------... | | | is true. (1) | +--------------------------------+-----------------------------------------------+ | ``t1 = t2 * f or t1 = f * t2`` | Delta multiplied by a float.
The result is |
| | rounded to the nearest multiple of |
| | timedelta.resolution using round-half-to-even.|
+--------------------------------+-----------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ff5cacf9-8768-4adf-b907-be192da84f7f | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,666 | supabase-export-v2 | e881e724f943bf33 | same validations as in datetime.tzinfo if not isinstance(when, dt.datetime): raise TypeError("fromutc() requires a datetime argument") if when.tzinfo is not self: raise ValueError("when.tzinfo is not self")
# A custom implementation is required for fromutc as
# the input to this function is a datetime with utc values
... | trusted_official_docs | CPython Docs | same validations as in datetime.tzinfo if not isinstance(when, dt.datetime): raise TypeError("fromutc() requires a datetime argument") if when.tzinfo is not self: raise ValueError("when.tzinfo is not self")
# A custom implementation is required for fromutc as
# the input to this function is a datetime with utc values
... | same validations as in datetime.tzinfo if not isinstance(when, dt.datetime): raise TypeError("fromutc() requires a datetime argument") if when.tzinfo is not self: raise ValueError("when.tzinfo is not self")
# A custom implementation is required for fromutc as
# the input to this function is a datetime with utc values
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ffa21fc5-b5f8-4619-958b-e6ce22fc11dc | CPython Docs | file://datasets/cpython/Doc/library/datetime.rst | unknown | 821ecadd-5a9b-4ba2-a0f4-7999c584a5c7 | 25,697 | supabase-export-v2 | a8177b234122c758 | are compared. If both comparands are aware and have different :attr:`!tzinfo` attributes, the comparands are first adjusted by subtracting their UTC offsets (obtained from ``self.utcoffset()``).
.. versionchanged:: 3.3
Equality comparisons between aware and naive :class:`.time` instances
don't raise :exc:`TypeError`. | trusted_official_docs | CPython Docs | are compared. If both comparands are aware and have different :attr:`!tzinfo` attributes, the comparands are first adjusted by subtracting their UTC offsets (obtained from ``self.utcoffset()``).
.. versionchanged:: 3.3
Equality comparisons between aware and naive :class:`.time` instances
don't raise :exc:`TypeError`. | are compared. If both comparands are aware and have different :attr:`!tzinfo` attributes, the comparands are first adjusted by subtracting their UTC offsets (obtained from ``self.utcoffset()``).
.. versionchanged:: 3.3
Equality comparisons between aware and naive :class:`.time` instances
don't raise :exc:`TypeError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
039cd8b2-3b63-41db-b6b5-8308e8991e07 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,215 | supabase-export-v2 | 8185b58df84034f7 | (other than a type object) that accepts an exception as its single argument and returns true for the exceptions that should be in the subgroup.
The nesting structure of the current exception is preserved in the result,
as are the values of its :attr:`message`,
:attr:`~BaseException.__traceback__`, :attr:`~BaseExcepti... | trusted_official_docs | CPython Docs | (other than a type object) that accepts an exception as its single argument and returns true for the exceptions that should be in the subgroup.
The nesting structure of the current exception is preserved in the result,
as are the values of its :attr:`message`,
:attr:`~BaseException.__traceback__`, :attr:`~BaseExcepti... | (other than a type object) that accepts an exception as its single argument and returns true for the exceptions that should be in the subgroup.
The nesting structure of the current exception is preserved in the result,
as are the values of its :attr:`message`,
:attr:`~BaseException.__traceback__`, :attr:`~BaseExcepti... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c0c55df-0a11-46a1-bda5-1a818acaa823 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,963 | supabase-export-v2 | d0259f02752513c7 | when an attribute reference (see :ref:`attribute-references`) or assignment fails. (When an object does not support attribute references or attribute assignments at all, :exc:`TypeError` is raised.)
The optional *name* and *obj* keyword-only arguments
set the corresponding attributes: | trusted_official_docs | CPython Docs | when an attribute reference (see :ref:`attribute-references`) or assignment fails. (When an object does not support attribute references or attribute assignments at all, :exc:`TypeError` is raised.)
The optional *name* and *obj* keyword-only arguments
set the corresponding attributes: | when an attribute reference (see :ref:`attribute-references`) or assignment fails. (When an object does not support attribute references or attribute assignments at all, :exc:`TypeError` is raised.)
The optional *name* and *obj* keyword-only arguments
set the corresponding attributes: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ef03292-0bda-4139-a863-7725ae270818 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,010 | supabase-export-v2 | 104d977e3d09b0d6 | and :data:`!NotImplemented` are not interchangeable. This exception should only be used as described above; see :data:`NotImplemented` for details on correct usage of the built-in constant.
.. exception:: OSError([arg])
OSError(errno, strerror[, filename[, winerror[, filename2]]]) | trusted_official_docs | CPython Docs | and :data:`!NotImplemented` are not interchangeable. This exception should only be used as described above; see :data:`NotImplemented` for details on correct usage of the built-in constant.
.. exception:: OSError([arg])
OSError(errno, strerror[, filename[, winerror[, filename2]]]) | and :data:`!NotImplemented` are not interchangeable. This exception should only be used as described above; see :data:`NotImplemented` for details on correct usage of the built-in constant.
.. exception:: OSError([arg])
OSError(errno, strerror[, filename[, winerror[, filename2]]]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0f0ff9ee-f56f-4d30-b227-4695a122c990 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,027 | supabase-export-v2 | d4c6bcc8e73768d4 | .. exception:: OverflowError
Raised when the result of an arithmetic operation is too large to be
represented. This cannot occur for integers (which would rather raise
:exc:`MemoryError` than give up). However, for historical reasons,
OverflowError is sometimes raised for integers that are outside a required
range.... | trusted_official_docs | CPython Docs | .. exception:: OverflowError
Raised when the result of an arithmetic operation is too large to be
represented. This cannot occur for integers (which would rather raise
:exc:`MemoryError` than give up). However, for historical reasons,
OverflowError is sometimes raised for integers that are outside a required
range.... | .. exception:: OverflowError
Raised when the result of an arithmetic operation is too large to be
represented. This cannot occur for integers (which would rather raise
:exc:`MemoryError` than give up). However, for historical reasons,
OverflowError is sometimes raised for integers that are outside a required
range.... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
152adb1d-50c6-4341-8f0b-a3259adb20a1 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,914 | supabase-export-v2 | 38f726c8ca289d24 | .. index:: pair: statement; try pair: statement; except
In Python, all exceptions must be instances of a class that derives from
:class:`BaseException`. In a :keyword:`try` statement with an :keyword:`except`
clause that mentions a particular class, that clause also handles any exception
classes derived from that class... | trusted_official_docs | CPython Docs | .. index:: pair: statement; try pair: statement; except
In Python, all exceptions must be instances of a class that derives from
:class:`BaseException`. In a :keyword:`try` statement with an :keyword:`except`
clause that mentions a particular class, that clause also handles any exception
classes derived from that class... | .. index:: pair: statement; try pair: statement; except
In Python, all exceptions must be instances of a class that derives from
:class:`BaseException`. In a :keyword:`try` statement with an :keyword:`except`
clause that mentions a particular class, that clause also handles any exception
classes derived from that class... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16e4a41a-c510-4278-ad7e-cf801281a2e7 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,955 | supabase-export-v2 | 5492cc14835ae68b | .. exception:: LookupError
The base class for the exceptions that are raised when a key or index used on
a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. This
can be raised directly by :func:`codecs.lookup`. | trusted_official_docs | CPython Docs | .. exception:: LookupError
The base class for the exceptions that are raised when a key or index used on
a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. This
can be raised directly by :func:`codecs.lookup`. | .. exception:: LookupError
The base class for the exceptions that are raised when a key or index used on
a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. This
can be raised directly by :func:`codecs.lookup`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
18a84c63-4f26-4ff1-9ecd-4ce84501d219 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,989 | supabase-export-v2 | 97c49c3b8b5ef9be | is out of range. (Slice indices are silently truncated to fall in the allowed range; if an index is not an integer, :exc:`TypeError` is raised.)
.. XXX xref to sequences | trusted_official_docs | CPython Docs | is out of range. (Slice indices are silently truncated to fall in the allowed range; if an index is not an integer, :exc:`TypeError` is raised.)
.. XXX xref to sequences | is out of range. (Slice indices are silently truncated to fall in the allowed range; if an index is not an integer, :exc:`TypeError` is raised.)
.. XXX xref to sequences | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
19ce5ed8-68d3-45e0-933d-226b3c4c04a9 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,916 | supabase-export-v2 | 427029c39844e220 | .. index:: pair: statement; raise
The built-in exceptions listed in this chapter can be generated by the interpreter or
built-in functions. Except where mentioned, they have an "associated value"
indicating the detailed cause of the error. This may be a string or a tuple of
several items of information (e.g., an error ... | trusted_official_docs | CPython Docs | .. index:: pair: statement; raise
The built-in exceptions listed in this chapter can be generated by the interpreter or
built-in functions. Except where mentioned, they have an "associated value"
indicating the detailed cause of the error. This may be a string or a tuple of
several items of information (e.g., an error ... | .. index:: pair: statement; raise
The built-in exceptions listed in this chapter can be generated by the interpreter or
built-in functions. Except where mentioned, they have an "associated value"
indicating the detailed cause of the error. This may be a string or a tuple of
several items of information (e.g., an error ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1cb2de2b-b464-4b8a-a9d5-bfa84bcdbe2a | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,176 | supabase-export-v2 | 45fdc39069fb0e00 | Base class for warnings about features which are obsolete and expected to be deprecated in the future, but are not deprecated at the moment.
This class is rarely used as emitting a warning about a possible
upcoming deprecation is unusual, and :exc:`DeprecationWarning`
is preferred for already active deprecations. | trusted_official_docs | CPython Docs | Base class for warnings about features which are obsolete and expected to be deprecated in the future, but are not deprecated at the moment.
This class is rarely used as emitting a warning about a possible
upcoming deprecation is unusual, and :exc:`DeprecationWarning`
is preferred for already active deprecations. | Base class for warnings about features which are obsolete and expected to be deprecated in the future, but are not deprecated at the moment.
This class is rarely used as emitting a warning about a possible
upcoming deprecation is unusual, and :exc:`DeprecationWarning`
is preferred for already active deprecations. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1dc21f09-cfe6-4e6f-b802-92b3a9b0d604 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,938 | supabase-export-v2 | 680f8c45bff95e55 | .. attribute:: args
The tuple of arguments given to the exception constructor. Some built-in
exceptions (like :exc:`OSError`) expect a certain number of arguments and
assign a special meaning to the elements of this tuple, while others are
usually called only with a single string giving an error message. | trusted_official_docs | CPython Docs | .. attribute:: args
The tuple of arguments given to the exception constructor. Some built-in
exceptions (like :exc:`OSError`) expect a certain number of arguments and
assign a special meaning to the elements of this tuple, while others are
usually called only with a single string giving an error message. | .. attribute:: args
The tuple of arguments given to the exception constructor. Some built-in
exceptions (like :exc:`OSError`) expect a certain number of arguments and
assign a special meaning to the elements of this tuple, while others are
usually called only with a single string giving an error message. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1fe3e1b3-0760-4fb7-845f-f2acbc165d1f | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,040 | supabase-export-v2 | 41a75a3011b27627 | This exception is derived from :exc:`RuntimeError`. It is raised when the interpreter detects that the maximum recursion depth (see :func:`sys.getrecursionlimit`) is exceeded.
.. versionadded:: 3.5
Previously, a plain :exc:`RuntimeError` was raised. | trusted_official_docs | CPython Docs | This exception is derived from :exc:`RuntimeError`. It is raised when the interpreter detects that the maximum recursion depth (see :func:`sys.getrecursionlimit`) is exceeded.
.. versionadded:: 3.5
Previously, a plain :exc:`RuntimeError` was raised. | This exception is derived from :exc:`RuntimeError`. It is raised when the interpreter detects that the maximum recursion depth (see :func:`sys.getrecursionlimit`) is exceeded.
.. versionadded:: 3.5
Previously, a plain :exc:`RuntimeError` was raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27df8ce2-aecc-4241-b55d-c9475f17ae70 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,945 | supabase-export-v2 | e1b86d68a93d9424 | .. method:: add_note(note)
Add the string ``note`` to the exception's notes which appear in the standard
traceback after the exception string. A :exc:`TypeError` is raised if ``note``
is not a string. | trusted_official_docs | CPython Docs | .. method:: add_note(note)
Add the string ``note`` to the exception's notes which appear in the standard
traceback after the exception string. A :exc:`TypeError` is raised if ``note``
is not a string. | .. method:: add_note(note)
Add the string ``note`` to the exception's notes which appear in the standard
traceback after the exception string. A :exc:`TypeError` is raised if ``note``
is not a string. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2867f328-746e-404d-a186-87d66b84f7b2 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,997 | supabase-export-v2 | 3474ebcc7c9f81c0 | .. exception:: MemoryError
Raised when an operation runs out of memory but the situation may still be
rescued (by deleting some objects). The associated value is a string indicating
what kind of (internal) operation ran out of memory. Note that because of the
underlying memory management architecture (C's :c:func:`m... | trusted_official_docs | CPython Docs | .. exception:: MemoryError
Raised when an operation runs out of memory but the situation may still be
rescued (by deleting some objects). The associated value is a string indicating
what kind of (internal) operation ran out of memory. Note that because of the
underlying memory management architecture (C's :c:func:`m... | .. exception:: MemoryError
Raised when an operation runs out of memory but the situation may still be
rescued (by deleting some objects). The associated value is a string indicating
what kind of (internal) operation ran out of memory. Note that because of the
underlying memory management architecture (C's :c:func:`m... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
28b2ca7f-e9e9-4fbb-9065-bccf7ad11bf6 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,976 | supabase-export-v2 | 90245209721d2a47 | statement has troubles trying to load a module. Also raised when the "from list" in ``from ... import`` has a name that cannot be found.
The optional *name* and *path* keyword-only arguments
set the corresponding attributes: | trusted_official_docs | CPython Docs | statement has troubles trying to load a module. Also raised when the "from list" in ``from ... import`` has a name that cannot be found.
The optional *name* and *path* keyword-only arguments
set the corresponding attributes: | statement has troubles trying to load a module. Also raised when the "from list" in ``from ... import`` has a name that cannot be found.
The optional *name* and *path* keyword-only arguments
set the corresponding attributes: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2add094a-aa71-4d0f-882f-e31dd8b478fa | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,083 | supabase-export-v2 | 1d3976484bc4a51d | the exit status is zero; if it has another type (such as a string), the object's value is printed and the exit status is one.
A call to :func:`sys.exit` is translated into an exception so that clean-up
handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be
executed, and so that a debugger can execu... | trusted_official_docs | CPython Docs | the exit status is zero; if it has another type (such as a string), the object's value is printed and the exit status is one.
A call to :func:`sys.exit` is translated into an exception so that clean-up
handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be
executed, and so that a debugger can execu... | the exit status is zero; if it has another type (such as a string), the object's value is printed and the exit status is one.
A call to :func:`sys.exit` is translated into an exception so that clean-up
handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be
executed, and so that a debugger can execu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2cd0da15-2a78-4550-9abb-0c99974280b5 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,031 | supabase-export-v2 | 7175ad2dd829c071 | Examples of operations which can be blocked with a :exc:`PythonFinalizationError` during the Python finalization:
* Creating a new Python thread. * :meth:`Joining <threading.Thread.join>` a running daemon thread. * :func:`os.fork`,
* acquiring a lock such as :class:`threading.Lock`, when it is known that
the operatio... | trusted_official_docs | CPython Docs | Examples of operations which can be blocked with a :exc:`PythonFinalizationError` during the Python finalization:
* Creating a new Python thread. * :meth:`Joining <threading.Thread.join>` a running daemon thread. * :func:`os.fork`,
* acquiring a lock such as :class:`threading.Lock`, when it is known that
the operatio... | Examples of operations which can be blocked with a :exc:`PythonFinalizationError` during the Python finalization:
* Creating a new Python thread. * :meth:`Joining <threading.Thread.join>` a running daemon thread. * :func:`os.fork`,
* acquiring a lock such as :class:`threading.Lock`, when it is known that
the operatio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
31655b65-4763-45d6-9a5d-4d0d32d5d8d4 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,088 | supabase-export-v2 | 815f0ef44201465d | when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch.
This exception may be raised by user code to indicate that an attempted
operation on an object is not supported, and is not meant to be. If an object
is meant to suppor... | trusted_official_docs | CPython Docs | when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch.
This exception may be raised by user code to indicate that an attempted
operation on an object is not supported, and is not meant to be. If an object
is meant to suppor... | when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch.
This exception may be raised by user code to indicate that an attempted
operation on an object is not supported, and is not meant to be. If an object
is meant to suppor... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
320dc4ef-13e0-4237-ac17-8625f7546eb8 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,216 | supabase-export-v2 | 7cd390534a6dd0e7 | preserved in the result, as are the values of its :attr:`message`, :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` and :attr:`~BaseException.__notes__` fields. Empty nested groups are omitted from the result.
The condition is checked for all exceptions in the n... | trusted_official_docs | CPython Docs | preserved in the result, as are the values of its :attr:`message`, :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` and :attr:`~BaseException.__notes__` fields. Empty nested groups are omitted from the result.
The condition is checked for all exceptions in the n... | preserved in the result, as are the values of its :attr:`message`, :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` and :attr:`~BaseException.__notes__` fields. Empty nested groups are omitted from the result.
The condition is checked for all exceptions in the n... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3583a8c6-2696-4007-8186-667bdcd14070 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,059 | supabase-export-v2 | 13dde06604be9cc6 | an :keyword:`import` statement, in a call to the built-in functions :func:`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script or standard input (also interactively).
The :func:`str` of the exception instance returns only the error message. Details is a tuple whose members are also available as ... | trusted_official_docs | CPython Docs | an :keyword:`import` statement, in a call to the built-in functions :func:`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script or standard input (also interactively).
The :func:`str` of the exception instance returns only the error message. Details is a tuple whose members are also available as ... | an :keyword:`import` statement, in a call to the built-in functions :func:`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script or standard input (also interactively).
The :func:`str` of the exception instance returns only the error message. Details is a tuple whose members are also available as ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
36a144f3-91cf-44ec-a9e7-153f7036ab2e | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,053 | supabase-export-v2 | 39fd45b97f493182 | .. versionchanged:: 3.5 Introduced the RuntimeError transformation via ``from __future__ import generator_stop``, see :pep:`479`.
.. versionchanged:: 3.7
Enable :pep:`479` for all code by default: a :exc:`StopIteration`
error raised in a generator is transformed into a :exc:`RuntimeError`. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.5 Introduced the RuntimeError transformation via ``from __future__ import generator_stop``, see :pep:`479`.
.. versionchanged:: 3.7
Enable :pep:`479` for all code by default: a :exc:`StopIteration`
error raised in a generator is transformed into a :exc:`RuntimeError`. | .. versionchanged:: 3.5 Introduced the RuntimeError transformation via ``from __future__ import generator_stop``, see :pep:`479`.
.. versionchanged:: 3.7
Enable :pep:`479` for all code by default: a :exc:`StopIteration`
error raised in a generator is transformed into a :exc:`RuntimeError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
389fc97e-1641-4364-9313-4156e94be4e4 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,073 | supabase-export-v2 | b6f37208d9c6aec2 | from the replacement expression. For example, compiling f'Bad {a b} field' results in this args attribute: ('f-string: ...', ('', 1, 2, '(a b)\n', 1, 5)).
.. versionchanged:: 3.10
Added the :attr:`end_lineno` and :attr:`end_offset` attributes. | trusted_official_docs | CPython Docs | from the replacement expression. For example, compiling f'Bad {a b} field' results in this args attribute: ('f-string: ...', ('', 1, 2, '(a b)\n', 1, 5)).
.. versionchanged:: 3.10
Added the :attr:`end_lineno` and :attr:`end_offset` attributes. | from the replacement expression. For example, compiling f'Bad {a b} field' results in this args attribute: ('f-string: ...', ('', 1, 2, '(a b)\n', 1, 5)).
.. versionchanged:: 3.10
Added the :attr:`end_lineno` and :attr:`end_offset` attributes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
38fc3c1b-6306-486e-a854-8ac6e8bfa55c | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,155 | supabase-export-v2 | 2ca3094930bf583d | Raised when trying to run an operation without the adequate access rights - for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, and :py:const:`~errno.ENOTCAPABLE`.
.. versionchanged:: 3.11.1
WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to
:exc... | trusted_official_docs | CPython Docs | Raised when trying to run an operation without the adequate access rights - for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, and :py:const:`~errno.ENOTCAPABLE`.
.. versionchanged:: 3.11.1
WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to
:exc... | Raised when trying to run an operation without the adequate access rights - for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, and :py:const:`~errno.ENOTCAPABLE`.
.. versionchanged:: 3.11.1
WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to
:exc... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fd20e7c-8fba-4e5b-a9b9-7b7bc065d902 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,975 | supabase-export-v2 | 1b84b3f6624f94c0 | .. exception:: ImportError
Raised when the :keyword:`import` statement has troubles trying to
load a module. Also raised when the "from list" in ``from ... import``
has a name that cannot be found. | trusted_official_docs | CPython Docs | .. exception:: ImportError
Raised when the :keyword:`import` statement has troubles trying to
load a module. Also raised when the "from list" in ``from ... import``
has a name that cannot be found. | .. exception:: ImportError
Raised when the :keyword:`import` statement has troubles trying to
load a module. Also raised when the "from list" in ``from ... import``
has a name that cannot be found. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
41241481-252e-4356-aa6c-763b0bbe9866 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,049 | supabase-export-v2 | 5595e004697f1daa | The exception object has a single attribute :attr:`!value`, which is given as an argument when constructing the exception, and defaults to :const:`None`.
When a :term:`generator` or :term:`coroutine` function
returns, a new :exc:`StopIteration` instance is
raised, and the value returned by the function is used as the... | trusted_official_docs | CPython Docs | The exception object has a single attribute :attr:`!value`, which is given as an argument when constructing the exception, and defaults to :const:`None`.
When a :term:`generator` or :term:`coroutine` function
returns, a new :exc:`StopIteration` instance is
raised, and the value returned by the function is used as the... | The exception object has a single attribute :attr:`!value`, which is given as an argument when constructing the exception, and defaults to :const:`None`.
When a :term:`generator` or :term:`coroutine` function
returns, a new :exc:`StopIteration` instance is
raised, and the value returned by the function is used as the... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
426adeaa-c0f8-4a5b-bcf7-0b3cc34ef98a | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,227 | supabase-export-v2 | 410f7e99ade029c2 | match.__notes__ (MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), ['a note']) >>> rest, rest.__context__, rest.__cause__, rest.__notes__ (MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), ['a note']) >>> exc.__traceback__ is match.__traceback__ is rest.__traceback__ True
... | trusted_official_docs | CPython Docs | match.__notes__ (MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), ['a note']) >>> rest, rest.__context__, rest.__cause__, rest.__notes__ (MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), ['a note']) >>> exc.__traceback__ is match.__traceback__ is rest.__traceback__ True
... | match.__notes__ (MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), ['a note']) >>> rest, rest.__context__, rest.__cause__, rest.__notes__ (MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), ['a note']) >>> exc.__traceback__ is match.__traceback__ is rest.__traceback__ True
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
42dd7742-fa4e-4f24-8d1c-3951056af2c1 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,024 | supabase-export-v2 | 3a08ece28905fce2 | to the function. For functions that involve two file system paths (such as :func:`os.rename`), :attr:`filename2` corresponds to the second file name passed to the function.
.. versionchanged:: 3.3
:exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`,
:exc:`socket.error`, :exc:`select.error` and
:exc:`!mmap.e... | trusted_official_docs | CPython Docs | to the function. For functions that involve two file system paths (such as :func:`os.rename`), :attr:`filename2` corresponds to the second file name passed to the function.
.. versionchanged:: 3.3
:exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`,
:exc:`socket.error`, :exc:`select.error` and
:exc:`!mmap.e... | to the function. For functions that involve two file system paths (such as :func:`os.rename`), :attr:`filename2` corresponds to the second file name passed to the function.
.. versionchanged:: 3.3
:exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`,
:exc:`socket.error`, :exc:`select.error` and
:exc:`!mmap.e... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4470bd50-18b5-40fd-ba1c-b4215c60fde7 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,932 | supabase-export-v2 | bcc4bf62f8480828 | .. impl-detail::
Most built-in exceptions are implemented in C for efficiency, see:
:source:`Objects/exceptions.c`. Some have custom memory layouts
which makes it impossible to create a subclass that inherits from
multiple exception types. The memory layout of a type is an implementation
detail and might change bet... | trusted_official_docs | CPython Docs | .. impl-detail::
Most built-in exceptions are implemented in C for efficiency, see:
:source:`Objects/exceptions.c`. Some have custom memory layouts
which makes it impossible to create a subclass that inherits from
multiple exception types. The memory layout of a type is an implementation
detail and might change bet... | .. impl-detail::
Most built-in exceptions are implemented in C for efficiency, see:
:source:`Objects/exceptions.c`. Some have custom memory layouts
which makes it impossible to create a subclass that inherits from
multiple exception types. The memory layout of a type is an implementation
detail and might change bet... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
46f9e603-9bb8-4124-b681-e783c03d7b28 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,917 | supabase-export-v2 | 2ca12e4de32d104b | of information (e.g., an error code and a string explaining the code). The associated value is usually passed as arguments to the exception class's constructor.
User code can raise built-in exceptions. This can be used to test an exception
handler or to report an error condition "just like" the situation in which the
i... | trusted_official_docs | CPython Docs | of information (e.g., an error code and a string explaining the code). The associated value is usually passed as arguments to the exception class's constructor.
User code can raise built-in exceptions. This can be used to test an exception
handler or to report an error condition "just like" the situation in which the
i... | of information (e.g., an error code and a string explaining the code). The associated value is usually passed as arguments to the exception class's constructor.
User code can raise built-in exceptions. This can be used to test an exception
handler or to report an error condition "just like" the situation in which the
i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
49eedba8-0651-48e6-a2fe-461921669c96 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,152 | supabase-export-v2 | 154461b1ffdf1ef3 | .. exception:: NotADirectoryError
Raised when a directory operation (such as :func:`os.listdir`) is requested on
something which is not a directory. On most POSIX platforms, it may also be
raised if an operation attempts to open or traverse a non-directory file as if
it were a directory. Corresponds to :c:data:`errn... | trusted_official_docs | CPython Docs | .. exception:: NotADirectoryError
Raised when a directory operation (such as :func:`os.listdir`) is requested on
something which is not a directory. On most POSIX platforms, it may also be
raised if an operation attempts to open or traverse a non-directory file as if
it were a directory. Corresponds to :c:data:`errn... | .. exception:: NotADirectoryError
Raised when a directory operation (such as :func:`os.listdir`) is requested on
something which is not a directory. On most POSIX platforms, it may also be
raised if an operation attempts to open or traverse a non-directory file as if
it were a directory. Corresponds to :c:data:`errn... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4c2e4136-6a2e-45ab-bca8-2d6959283d6a | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,148 | supabase-export-v2 | e98b804a89a5a6e1 | Raised when a system call is interrupted by an incoming signal. Corresponds to :c:data:`errno` :py:const:`~errno.EINTR`.
.. versionchanged:: 3.5
Python now retries system calls when a syscall is interrupted by a
signal, except if the signal handler raises an exception (see :pep:`475`
for the rationale), instead of r... | trusted_official_docs | CPython Docs | Raised when a system call is interrupted by an incoming signal. Corresponds to :c:data:`errno` :py:const:`~errno.EINTR`.
.. versionchanged:: 3.5
Python now retries system calls when a syscall is interrupted by a
signal, except if the signal handler raises an exception (see :pep:`475`
for the rationale), instead of r... | Raised when a system call is interrupted by an incoming signal. Corresponds to :c:data:`errno` :py:const:`~errno.EINTR`.
.. versionchanged:: 3.5
Python now retries system calls when a syscall is interrupted by a
signal, except if the signal handler raises an exception (see :pep:`475`
for the rationale), instead of r... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4cb45d15-f557-4ef4-a47d-15b75807de20 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,929 | supabase-export-v2 | 9422e0c0fefe00c6 | exception itself is always shown after any chained exceptions so that the final line of the traceback always shows the last exception that was raised.
Inheriting from built-in exceptions
----------------------------------- | trusted_official_docs | CPython Docs | exception itself is always shown after any chained exceptions so that the final line of the traceback always shows the last exception that was raised.
Inheriting from built-in exceptions
----------------------------------- | exception itself is always shown after any chained exceptions so that the final line of the traceback always shows the last exception that was raised.
Inheriting from built-in exceptions
----------------------------------- | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4daa6163-8242-4865-88ab-f00b9e0f9fc0 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,019 | supabase-export-v2 | 8474baad5c16ea8c | Windows, this gives you the native Windows error code. The :attr:`.errno` attribute is then an approximate translation, in POSIX terms, of that native error code.
Under Windows, if the *winerror* constructor argument is an integer,
the :attr:`.errno` attribute is determined from the Windows error code,
and the *errno... | trusted_official_docs | CPython Docs | Windows, this gives you the native Windows error code. The :attr:`.errno` attribute is then an approximate translation, in POSIX terms, of that native error code.
Under Windows, if the *winerror* constructor argument is an integer,
the :attr:`.errno` attribute is determined from the Windows error code,
and the *errno... | Windows, this gives you the native Windows error code. The :attr:`.errno` attribute is then an approximate translation, in POSIX terms, of that native error code.
Under Windows, if the *winerror* constructor argument is an integer,
the :attr:`.errno` attribute is determined from the Windows error code,
and the *errno... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4f0af8d8-174c-406b-a18b-960732e7b197 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,052 | supabase-export-v2 | 47bd375c004b98f5 | .. versionchanged:: 3.3 Added ``value`` attribute and the ability for generator functions to use it to return a value.
.. versionchanged:: 3.5
Introduced the RuntimeError transformation via
``from __future__ import generator_stop``, see :pep:`479`. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.3 Added ``value`` attribute and the ability for generator functions to use it to return a value.
.. versionchanged:: 3.5
Introduced the RuntimeError transformation via
``from __future__ import generator_stop``, see :pep:`479`. | .. versionchanged:: 3.3 Added ``value`` attribute and the ability for generator functions to use it to return a value.
.. versionchanged:: 3.5
Introduced the RuntimeError transformation via
``from __future__ import generator_stop``, see :pep:`479`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4f17169c-8272-4d57-98b2-22ec461b2c64 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,058 | supabase-export-v2 | 6b77e0c0cbc0556a | .. exception:: SyntaxError(message, details)
Raised when the parser encounters a syntax error. This may occur in an
:keyword:`import` statement, in a call to the built-in functions
:func:`compile`, :func:`exec`,
or :func:`eval`, or when reading the initial script or standard input
(also interactively). | trusted_official_docs | CPython Docs | .. exception:: SyntaxError(message, details)
Raised when the parser encounters a syntax error. This may occur in an
:keyword:`import` statement, in a call to the built-in functions
:func:`compile`, :func:`exec`,
or :func:`eval`, or when reading the initial script or standard input
(also interactively). | .. exception:: SyntaxError(message, details)
Raised when the parser encounters a syntax error. This may occur in an
:keyword:`import` statement, in a call to the built-in functions
:func:`compile`, :func:`exec`,
or :func:`eval`, or when reading the initial script or standard input
(also interactively). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4f17f1a6-3eb2-499a-8c90-2197187f504a | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,930 | supabase-export-v2 | f3dfd74a53a0c009 | Inheriting from built-in exceptions -----------------------------------
User code can create subclasses that inherit from an exception type. It's recommended to only subclass one exception type at a time to avoid
any possible conflicts between how the bases handle the ``args``
attribute, as well as due to possible memo... | trusted_official_docs | CPython Docs | Inheriting from built-in exceptions -----------------------------------
User code can create subclasses that inherit from an exception type. It's recommended to only subclass one exception type at a time to avoid
any possible conflicts between how the bases handle the ``args``
attribute, as well as due to possible memo... | Inheriting from built-in exceptions -----------------------------------
User code can create subclasses that inherit from an exception type. It's recommended to only subclass one exception type at a time to avoid
any possible conflicts between how the bases handle the ``args``
attribute, as well as due to possible memo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
523ce8ce-83c6-4121-acc7-99248e610732 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,923 | supabase-export-v2 | 9d945dbdea789d43 | .. attribute:: BaseException.__context__ BaseException.__cause__ BaseException.__suppress_context__
When raising a new exception while another exception
is already being handled, the new exception's
:attr:`!__context__` attribute is automatically set to the handled
exception. An exception may be handled when an :key... | trusted_official_docs | CPython Docs | .. attribute:: BaseException.__context__ BaseException.__cause__ BaseException.__suppress_context__
When raising a new exception while another exception
is already being handled, the new exception's
:attr:`!__context__` attribute is automatically set to the handled
exception. An exception may be handled when an :key... | .. attribute:: BaseException.__context__ BaseException.__cause__ BaseException.__suppress_context__
When raising a new exception while another exception
is already being handled, the new exception's
:attr:`!__context__` attribute is automatically set to the handled
exception. An exception may be handled when an :key... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
52d36422-06be-40c5-86ad-d6f5ae515636 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,135 | supabase-export-v2 | 3c48b5cefec6ac20 | .. exception:: BrokenPipeError
A subclass of :exc:`ConnectionError`, raised when trying to write on a
pipe while the other end has been closed, or trying to write on a socket
which has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`. | trusted_official_docs | CPython Docs | .. exception:: BrokenPipeError
A subclass of :exc:`ConnectionError`, raised when trying to write on a
pipe while the other end has been closed, or trying to write on a socket
which has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`. | .. exception:: BrokenPipeError
A subclass of :exc:`ConnectionError`, raised when trying to write on a
pipe while the other end has been closed, or trying to write on a socket
which has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5403c8b5-565e-4f8b-b7ba-a2e95c451bae | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 25,921 | supabase-export-v2 | a8a1bac3e78cd3cb | .. index:: pair: exception; chaining __cause__ (exception attribute) __context__ (exception attribute) __suppress_context__ (exception attribute)
Three attributes on exception objects provide information about the context in
which the exception was raised: | trusted_official_docs | CPython Docs | .. index:: pair: exception; chaining __cause__ (exception attribute) __context__ (exception attribute) __suppress_context__ (exception attribute)
Three attributes on exception objects provide information about the context in
which the exception was raised: | .. index:: pair: exception; chaining __cause__ (exception attribute) __context__ (exception attribute) __suppress_context__ (exception attribute)
Three attributes on exception objects provide information about the context in
which the exception was raised: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
54897bb5-9870-4b38-8db7-be18c654367b | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,226 | supabase-export-v2 | 306ae9157b3cd880 | e.add_note("a note") >>> e.__context__ = Exception("context") >>> e.__cause__ = Exception("cause") >>> try: ... raise e ... except Exception as e: ... exc = e ...
>>> match, rest = exc.split(ValueError)
>>> exc, exc.__context__, exc.__cause__, exc.__notes__
(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('co... | trusted_official_docs | CPython Docs | e.add_note("a note") >>> e.__context__ = Exception("context") >>> e.__cause__ = Exception("cause") >>> try: ... raise e ... except Exception as e: ... exc = e ...
>>> match, rest = exc.split(ValueError)
>>> exc, exc.__context__, exc.__cause__, exc.__notes__
(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('co... | e.add_note("a note") >>> e.__context__ = Exception("context") >>> e.__cause__ = Exception("cause") >>> try: ... raise e ... except Exception as e: ... exc = e ...
>>> match, rest = exc.split(ValueError)
>>> exc, exc.__context__, exc.__cause__, exc.__notes__
(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5534b439-1873-4858-9124-b18f4249b1f8 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,005 | supabase-export-v2 | 0353e8cdc7e67aa2 | .. exception:: NotImplementedError
This exception is derived from :exc:`RuntimeError`. In user defined base
classes, abstract methods should raise this exception when they require
derived classes to override the method, or while the class is being
developed to indicate that the real implementation still needs to be ... | trusted_official_docs | CPython Docs | .. exception:: NotImplementedError
This exception is derived from :exc:`RuntimeError`. In user defined base
classes, abstract methods should raise this exception when they require
derived classes to override the method, or while the class is being
developed to indicate that the real implementation still needs to be ... | .. exception:: NotImplementedError
This exception is derived from :exc:`RuntimeError`. In user defined base
classes, abstract methods should raise this exception when they require
derived classes to override the method, or while the class is being
developed to indicate that the real implementation still needs to be ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6019077e-825e-4db2-9dce-ce99131f88f5 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,025 | supabase-export-v2 | 58735c7b712a5117 | .. versionchanged:: 3.3 :exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket.error`, :exc:`select.error` and :exc:`!mmap.error` have been merged into :exc:`OSError`, and the constructor may return a subclass.
.. versionchanged:: 3.4
The :attr:`filename` attribute is now the original file name pas... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.3 :exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket.error`, :exc:`select.error` and :exc:`!mmap.error` have been merged into :exc:`OSError`, and the constructor may return a subclass.
.. versionchanged:: 3.4
The :attr:`filename` attribute is now the original file name pas... | .. versionchanged:: 3.3 :exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket.error`, :exc:`select.error` and :exc:`!mmap.error` have been merged into :exc:`OSError`, and the constructor may return a subclass.
.. versionchanged:: 3.4
The :attr:`filename` attribute is now the original file name pas... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
60e6563a-e984-4efd-96f8-1465ac59ae70 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,000 | supabase-export-v2 | e0ab6b699379b634 | is not found. This applies only to unqualified names. The associated value is an error message that includes the name that could not be found.
The optional *name* keyword-only argument sets the attribute: | trusted_official_docs | CPython Docs | is not found. This applies only to unqualified names. The associated value is an error message that includes the name that could not be found.
The optional *name* keyword-only argument sets the attribute: | is not found. This applies only to unqualified names. The associated value is an error message that includes the name that could not be found.
The optional *name* keyword-only argument sets the attribute: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
61a99e42-38ed-4943-ae4b-2a475c3512c0 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,214 | supabase-export-v2 | af6eb7174e80f5d7 | Returns an exception group that contains only the exceptions from the current group that match *condition*, or ``None`` if the result is empty.
The condition can be an exception type or tuple of exception types, in which
case each exception is checked for a match using the same check that is used
in an ``except`` cla... | trusted_official_docs | CPython Docs | Returns an exception group that contains only the exceptions from the current group that match *condition*, or ``None`` if the result is empty.
The condition can be an exception type or tuple of exception types, in which
case each exception is checked for a match using the same check that is used
in an ``except`` cla... | Returns an exception group that contains only the exceptions from the current group that match *condition*, or ``None`` if the result is empty.
The condition can be an exception type or tuple of exception types, in which
case each exception is checked for a match using the same check that is used
in an ``except`` cla... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
62dc62f0-e8ec-468a-9d9c-9c041d43fbe2 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,172 | supabase-export-v2 | dc1383e5c943b4f5 | Base class for warnings about deprecated features when those warnings are intended for other Python developers.
Ignored by the default warning filters, except in the ``__main__`` module
(:pep:`565`). Enabling the :ref:`Python Development Mode <devmode>` shows
this warning. | trusted_official_docs | CPython Docs | Base class for warnings about deprecated features when those warnings are intended for other Python developers.
Ignored by the default warning filters, except in the ``__main__`` module
(:pep:`565`). Enabling the :ref:`Python Development Mode <devmode>` shows
this warning. | Base class for warnings about deprecated features when those warnings are intended for other Python developers.
Ignored by the default warning filters, except in the ``__main__`` module
(:pep:`565`). Enabling the :ref:`Python Development Mode <devmode>` shows
this warning. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
675d8401-8eda-4cd9-ba58-a399ff1bd53d | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,222 | supabase-export-v2 | 556e0bb30f7f972d | Returns an exception group with the same :attr:`message`, but which wraps the exceptions in ``excs``.
This method is used by :meth:`subgroup` and :meth:`split`, which
are used in various contexts to break up an exception group. A
subclass needs to override it in order to make :meth:`subgroup`
and :meth:`split` retur... | trusted_official_docs | CPython Docs | Returns an exception group with the same :attr:`message`, but which wraps the exceptions in ``excs``.
This method is used by :meth:`subgroup` and :meth:`split`, which
are used in various contexts to break up an exception group. A
subclass needs to override it in order to make :meth:`subgroup`
and :meth:`split` retur... | Returns an exception group with the same :attr:`message`, but which wraps the exceptions in ``excs``.
This method is used by :meth:`subgroup` and :meth:`split`, which
are used in various contexts to break up an exception group. A
subclass needs to override it in order to make :meth:`subgroup`
and :meth:`split` retur... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6aae82f9-505a-4161-b1bf-cab2bbe3d6ec | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,223 | supabase-export-v2 | b97ecefc301a077b | up an exception group. A subclass needs to override it in order to make :meth:`subgroup` and :meth:`split` return instances of the subclass rather than :exc:`ExceptionGroup`.
:meth:`subgroup` and :meth:`split` copy the
:attr:`~BaseException.__traceback__`,
:attr:`~BaseException.__cause__`, :attr:`~BaseException.__con... | trusted_official_docs | CPython Docs | up an exception group. A subclass needs to override it in order to make :meth:`subgroup` and :meth:`split` return instances of the subclass rather than :exc:`ExceptionGroup`.
:meth:`subgroup` and :meth:`split` copy the
:attr:`~BaseException.__traceback__`,
:attr:`~BaseException.__cause__`, :attr:`~BaseException.__con... | up an exception group. A subclass needs to override it in order to make :meth:`subgroup` and :meth:`split` return instances of the subclass rather than :exc:`ExceptionGroup`.
:meth:`subgroup` and :meth:`split` copy the
:attr:`~BaseException.__traceback__`,
:attr:`~BaseException.__cause__`, :attr:`~BaseException.__con... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7a12655b-fb84-4d98-9c26-fb3b6d1dd254 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,203 | supabase-export-v2 | cfa9ace0bb1680c8 | with :keyword:`except` like all other exceptions. In addition, they are recognised by :keyword:`except*<except_star>`, which matches their subgroups based on the types of the contained exceptions.
.. exception:: ExceptionGroup(msg, excs)
.. exception:: BaseExceptionGroup(msg, excs) | trusted_official_docs | CPython Docs | with :keyword:`except` like all other exceptions. In addition, they are recognised by :keyword:`except*<except_star>`, which matches their subgroups based on the types of the contained exceptions.
.. exception:: ExceptionGroup(msg, excs)
.. exception:: BaseExceptionGroup(msg, excs) | with :keyword:`except` like all other exceptions. In addition, they are recognised by :keyword:`except*<except_star>`, which matches their subgroups based on the types of the contained exceptions.
.. exception:: ExceptionGroup(msg, excs)
.. exception:: BaseExceptionGroup(msg, excs) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7b918c78-90e1-47e2-9713-65d5cbc501ac | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,079 | supabase-export-v2 | f5653a1fd8ca75b6 | .. exception:: SystemError
Raised when the interpreter finds an internal error, but the situation does not
look so serious to cause it to abandon all hope. The associated value is a
string indicating what went wrong (in low-level terms). In :term:`CPython`,
this could be raised by incorrectly using Python's C API, s... | trusted_official_docs | CPython Docs | .. exception:: SystemError
Raised when the interpreter finds an internal error, but the situation does not
look so serious to cause it to abandon all hope. The associated value is a
string indicating what went wrong (in low-level terms). In :term:`CPython`,
this could be raised by incorrectly using Python's C API, s... | .. exception:: SystemError
Raised when the interpreter finds an internal error, but the situation does not
look so serious to cause it to abandon all hope. The associated value is a
string indicating what went wrong (in low-level terms). In :term:`CPython`,
this could be raised by incorrectly using Python's C API, s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7bd8c31a-fede-40f0-9507-f3570e362e31 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,103 | supabase-export-v2 | 3f573daaa2f4bc9a | The first index of invalid data in :attr:`object`.
This value should not be negative as it is interpreted as an
absolute offset but this constraint is not enforced at runtime. | trusted_official_docs | CPython Docs | The first index of invalid data in :attr:`object`.
This value should not be negative as it is interpreted as an
absolute offset but this constraint is not enforced at runtime. | The first index of invalid data in :attr:`object`.
This value should not be negative as it is interpreted as an
absolute offset but this constraint is not enforced at runtime. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7d514561-ee62-4990-ad2c-7b5f8c4f05a7 | CPython Docs | file://datasets/cpython/Doc/library/exceptions.rst | unknown | f572fd1d-d5ae-4d99-870d-cc611f4518bf | 26,116 | supabase-export-v2 | 7d68be19657a0782 | .. exception:: ZeroDivisionError
Raised when the second argument of a division or modulo operation is zero. The
associated value is a string indicating the type of the operands and the
operation. | trusted_official_docs | CPython Docs | .. exception:: ZeroDivisionError
Raised when the second argument of a division or modulo operation is zero. The
associated value is a string indicating the type of the operands and the
operation. | .. exception:: ZeroDivisionError
Raised when the second argument of a division or modulo operation is zero. The
associated value is a string indicating the type of the operands and the
operation. | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.