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

Skip to content

Commit c70b9b3

Browse files
committed
Fix patch styling type hints
This change is not strictly correct, as these style classes don't actually inherit from the surrounding class, but it allows one to pass an instance of the style classes directly.
1 parent 5726fe3 commit c70b9b3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/matplotlib/patches.pyi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class _Style:
328328
def register(cls, name: str, style: type) -> None: ...
329329

330330
class BoxStyle(_Style):
331-
class Square:
331+
class Square(BoxStyle):
332332
pad: float
333333
def __init__(self, pad: float = ...) -> None: ...
334334
def __call__(
@@ -340,7 +340,7 @@ class BoxStyle(_Style):
340340
mutation_size: float,
341341
) -> Path: ...
342342

343-
class Circle:
343+
class Circle(BoxStyle):
344344
pad: float
345345
def __init__(self, pad: float = ...) -> None: ...
346346
def __call__(
@@ -352,7 +352,7 @@ class BoxStyle(_Style):
352352
mutation_size: float,
353353
) -> Path: ...
354354

355-
class Ellipse:
355+
class Ellipse(BoxStyle):
356356
pad: float
357357
def __init__(self, pad: float = ...) -> None: ...
358358
def __call__(
@@ -364,7 +364,7 @@ class BoxStyle(_Style):
364364
mutation_size: float,
365365
) -> Path: ...
366366

367-
class LArrow:
367+
class LArrow(BoxStyle):
368368
pad: float
369369
def __init__(self, pad: float = ...) -> None: ...
370370
def __call__(
@@ -386,7 +386,7 @@ class BoxStyle(_Style):
386386
mutation_size: float,
387387
) -> Path: ...
388388

389-
class DArrow:
389+
class DArrow(BoxStyle):
390390
pad: float
391391
def __init__(self, pad: float = ...) -> None: ...
392392
def __call__(
@@ -398,7 +398,7 @@ class BoxStyle(_Style):
398398
mutation_size: float,
399399
) -> Path: ...
400400

401-
class Round:
401+
class Round(BoxStyle):
402402
pad: float
403403
rounding_size: float | None
404404
def __init__(
@@ -413,7 +413,7 @@ class BoxStyle(_Style):
413413
mutation_size: float,
414414
) -> Path: ...
415415

416-
class Round4:
416+
class Round4(BoxStyle):
417417
pad: float
418418
rounding_size: float | None
419419
def __init__(
@@ -428,7 +428,7 @@ class BoxStyle(_Style):
428428
mutation_size: float,
429429
) -> Path: ...
430430

431-
class Sawtooth:
431+
class Sawtooth(BoxStyle):
432432
pad: float
433433
tooth_size: float | None
434434
def __init__(
@@ -454,7 +454,7 @@ class BoxStyle(_Style):
454454
) -> Path: ...
455455

456456
class ConnectionStyle(_Style):
457-
class _Base:
457+
class _Base(ConnectionStyle):
458458
class SimpleEvent:
459459
def __init__(self, xy: tuple[float, float]) -> None: ...
460460

@@ -529,7 +529,7 @@ class ConnectionStyle(_Style):
529529
) -> Path: ...
530530

531531
class ArrowStyle(_Style):
532-
class _Base:
532+
class _Base(ArrowStyle):
533533
@staticmethod
534534
def ensure_quadratic_bezier(path: Path) -> list[float]: ...
535535
def transmute(

0 commit comments

Comments
 (0)