Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbd72b3

Browse files
committed
Use '... or None' instead of 'Optional[...]'.
1 parent 7d73e9c commit dbd72b3

File tree

4 files changed

+25
-27
lines changed

4 files changed

+25
-27
lines changed

lib/matplotlib/artist.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,9 @@ def set_snap(self, snap):
538538
539539
Parameters
540540
----------
541-
snap : Optional[bool]
541+
snap : bool or None
542542
..
543-
ACCEPTS: Optional[bool]
543+
ACCEPTS: bool or None
544544
"""
545545
self._snap = snap
546546
self.stale = True
@@ -783,13 +783,13 @@ def set_rasterized(self, rasterized):
783783
"""
784784
Force rasterized (bitmap) drawing in vector backend output.
785785
786-
Defaults to None, which implies the backend's default behavior
786+
Defaults to None, which implies the backend's default behavior.
787787
788788
Parameters
789789
----------
790-
rasterized : Optional[bool]
790+
rasterized : bool or None
791791
..
792-
ACCEPTS: [True | False | None]
792+
ACCEPTS: bool or None
793793
"""
794794
if rasterized and not hasattr(self.draw, "_supports_rasterization"):
795795
warnings.warn("Rasterization of '%s' will be ignored" % self)

lib/matplotlib/axes/_base.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,23 +2203,20 @@ def margins(self, *args, **kw):
22032203

22042204
def set_rasterization_zorder(self, z):
22052205
"""
2206-
Set zorder value below which artists will be rasterized. Set to
2207-
``None`` to disable rasterizing of artists below a particular zorder.
2208-
2209-
..
2210-
ACCEPTS: Optional[float]
2211-
22122206
Parameters
22132207
----------
2214-
z : Optional[float]
2208+
z : float or None
2209+
zorder below which artists are rasterized. ``None`` means that
2210+
artists do not get rasterized based on zorder.
2211+
2212+
..
2213+
ACCEPTS: float or None
22152214
"""
22162215
self._rasterization_zorder = z
22172216
self.stale = True
22182217

22192218
def get_rasterization_zorder(self):
2220-
"""
2221-
Get zorder value below which artists will be rasterized
2222-
"""
2219+
"""Return the zorder value below which artists will be rasterized."""
22232220
return self._rasterization_zorder
22242221

22252222
def autoscale(self, enable=True, axis='both', tight=None):

lib/matplotlib/collections.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,13 @@ def contains(self, mouseevent):
373373

374374
def set_urls(self, urls):
375375
"""
376-
..
377-
ACCEPTS: Optional[Iterable[str]]
376+
Parameters
377+
----------
378+
urls : List[str] or None
379+
..
380+
ACCEPTS: List[str] or None
378381
"""
379-
if urls is None:
380-
self._urls = [None, ]
381-
else:
382-
self._urls = urls
382+
self._urls = urls if urls is not None else [None]
383383
self.stale = True
384384

385385
def get_urls(self):

lib/matplotlib/text.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,13 +1219,14 @@ def set_font_properties(self, fp):
12191219

12201220
def set_usetex(self, usetex):
12211221
"""
1222-
Set whether to render using TeX.
1223-
1224-
If ``None`` is given, the option will be reset to use the value of
1225-
``rcParams['text.usetex']``.
1222+
Parameters
1223+
----------
1224+
usetex : bool or None
1225+
Whether to render using TeX, ``None`` means to use the
1226+
``rcParams['text.usetex']``.
12261227
1227-
..
1228-
ACCEPTS: Optional[bool]
1228+
..
1229+
ACCEPTS: bool or None
12291230
"""
12301231
if usetex is None:
12311232
self._usetex = rcParams['text.usetex']

0 commit comments

Comments
 (0)