8000 PEP 615: consistent terminology (#1586) · python/peps@b085b2d · GitHub
  • [go: up one dir, main page]

    Skip to content

    Commit b085b2d

    Browse files
    authored
    PEP 615: consistent terminology (#1586)
    * PEP-615 consistent terminology It repeatedly refers to a ZoneInfo object as a "file", confusing it with either the file it was constructed from, or the IO object representing the file. * Further clarification of caching implications
    1 parent 7cff39a commit b085b2d

    File tree

    1 file changed

    +10
    -10
    lines changed

    1 file changed

    +10
    -10
    lines changed

    pep-0615.rst

    Lines changed: 10 additions & 10 deletions
    Original file line numberDiff line numberDiff line change
    @@ -134,7 +134,7 @@ behavior for end users.
    134134
    ``ZoneInfo`` objects are ejected when no references to them exist (for
    135135
    example, a cache implemented with a ``weakref.WeakValueDictionary``) — it is
    136136
    allowed but not required or recommended to implement this with a "strong"
    137-
    cache, where all ``ZoneInfo`` files are kept alive indefinitely.
    137+
    cache, where all ``ZoneInfo`` objects are kept alive indefinitely.
    138138

    139139
    .. code-block::
    140140
    @@ -190,11 +190,11 @@ of the interpreter, it must not invalidate any caches or modify any
    190190
    existing ``ZoneInfo`` objects. Newly constructed ``ZoneInfo`` objects, however,
    191191
    should come from the updated data source.
    192192

    193-
    This means that the point at which a ``ZoneInfo`` file is updated depends
    194-
    primarily on the semantics of the caching behavior. The only guaranteed way to
    195-
    get a ``ZoneInfo`` file from an updated data source is to induce a cache miss,
    196-
    either by bypassing the cache and using ``ZoneInfo.no_cache`` or by clearing the
    197-
    cache.
    193+
    This means that the point at which the data source is updated for new
    194+
    invocations of the ``ZoneInfo`` constructor depends primarily on the semantics
    195+
    of the caching behavior. The only guaranteed way to get a ``ZoneInfo`` object
    196+
    from an updated data source is to induce a cache miss, either by bypassing the
    197+
    cache and using ``ZoneInfo.no_cache`` or by clearing the cache.
    198198

    199199
    .. note::
    200200

    @@ -274,7 +274,7 @@ An example:
    274274
    275275
    276276
    When a ``key`` is not specified, the ``str`` operation should not fail, but
    277-
    should return the file's ``__repr__``::
    277+
    should return the objects's ``__repr__``::
    278278

    279279
    >>> zone = ZoneInfo.from_file(f)
    280280
    >>> str(zone)
    @@ -299,7 +299,7 @@ Rather than serializing all transition data, ``ZoneInfo`` objects will be
    299299
    serialized by key, and ``ZoneInfo`` objects constructed from raw files (even
    300300
    those with a value for ``key`` specified) cannot be pickled.
    301301

    302-
    The behavior of a ``ZoneInfo`` file depends on how it was constructed:
    302+
    The behavior of a ``ZoneInfo`` object depends on how it was constructed:
    303303

    304304
    1. ``ZoneInfo(key)``: When constructed with the primary constructor, a
    305305
    ``ZoneInfo`` object will be serialized by key, and when deserialized the
    @@ -701,7 +701,7 @@ implementation in ways that may not be compatible with a non-ICU-based
    701701
    implementation — particularly around the behavior of the cache.
    702702

    703703
    Since it seems like ICU cannot be used as simply an additional data source for
    704-
    ``ZoneInfo`` files, this PEP considers the ICU support to be out of scope, and
    704+
    ``ZoneInfo`` objects, this PEP considers the ICU support to be out of scope, and
    705705
    probably better supported by a third-party library.
    706706

    707707
    Alternative environment variable configurations
    @@ -846,7 +846,7 @@ Footnotes
    846846
    but user support mostly focuses on these three types.
    847847
    848848
    .. [b]
    849-
    The statement that identically constructed ``ZoneInfo`` files should be
    849+
    The statement that identically constructed ``ZoneInfo`` objects should be
    850850
    identical objects may be violated if the user deliberately clears the time
    851851
    zone cache.
    852852

    0 commit comments

    Comments
     (0)
    0