Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ The ``ZoneInfo`` class
195
195
196
196
The ``ZoneInfo `` class has two alternate constructors:
197
197
198
- .. classmethod :: ZoneInfo.from_file(fobj , /, key=None)
198
+ .. classmethod :: ZoneInfo.from_file(file_obj , /, key=None)
199
199
200
200
Constructs a ``ZoneInfo `` object from a file-like object returning bytes
201
201
(e.g. a file opened in binary mode or an :class: `io.BytesIO ` object).
@@ -325,7 +325,7 @@ The behavior of a ``ZoneInfo`` file depends on how it was constructed:
325
325
>>> a is b
326
326
False
327
327
328
- 3. ``ZoneInfo.from_file(fobj , /, key=None) ``: When constructed from a file, the
328
+ 3. ``ZoneInfo.from_file(file_obj , /, key=None) ``: When constructed from a file, the
329
329
``ZoneInfo `` object raises an exception on pickling. If an end user wants to
330
330
pickle a ``ZoneInfo `` constructed from a file, it is recommended that they
331
331
use a wrapper type or a custom serialization function: either serializing by
Original file line number Diff line number Diff line change @@ -75,12 +75,12 @@ def _new_instance(cls, key):
75
75
return obj
76
76
77
77
@classmethod
78
- def from_file (cls , fobj , / , key = None ):
78
+ def from_file (cls , file_obj , / , key = None ):
79
79
obj = super ().__new__ (cls )
80
80
obj ._key = key
81
81
obj ._file_path = None
82
- obj ._load_file (fobj )
83
- obj ._file_repr = repr (fobj )
82
+ obj ._load_file (file_obj )
83
+ obj ._file_repr = repr (file_obj )
84
84
85
85
# Disable pickling for objects created from files
86
86
obj .__reduce__ = obj ._file_reduce
<
2F82
svg aria-hidden="true" version="1.1" viewBox="0 0 340 84" xmlns="http://www.w3.org/2000/svg" class="DiffPlaceholder-module__DiffPlaceholderSVG--LNh5I">
0 commit comments