Skip to content

Commit

Permalink
Global state is another example that leads to fun.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Oct 25, 2022
1 parent 653ff7c commit ff245f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
20 changes: 14 additions & 6 deletions docs/before-you-deprecate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,20 @@ need or want to clarify:
* is being able to *raise* exceptions defined by your library part
of its public API? Or is only catching them considered public.

* a class in your library is defined using `attrs
<https://www.attrs.org>`_. Is calling `attrs.evolve` directly on
instances of your class considered public API, and your class is
thereby permanently coupled to `attrs.evolve`'s public API? Or is
your use of `attrs` as a library maintainer simply an implementation
detail?
* a class in your library is defined using `attrs`. Is calling
`attrs.evolve` directly on instances of your class considered
public API, and your class is thereby permanently coupled to
`attrs.evolve`'s public API? Or is your use of `attrs` as a
library maintainer simply an implementation detail?

* a function in your library calls `requests.get`, a function which
has mutable global state -- it allows someone to import the library
and e.g. define `Transport Adapters <requests:transport-adapters>`
which, even if done outside your library, affect how it will retrieve
the HTTP response. Is your library free to change its HTTP client to
another HTTP client even though this will potentially disrupt users
who expect their external change to have an affect on your library's
behavior?

* ...

Expand Down
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
"https://python-jsonschema.readthedocs.io/en/latest/",
None,
),
"packaging": ("https://packaging.python.org/", None),
"python": ("https://docs.python.org/", None),
"packaging": ("https://packaging.python.org/en/latest/", None),
"python": ("https://docs.python.org/3/", None),
"requests": ("https://requests.readthedocs.io/en/latest/", None),
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
}

Expand Down

0 comments on commit ff245f5

Please sign in to comment.