Skip to content

Commit

Permalink
Merge commit '791da521a78af940b7092b582748112fceee401a' into 313-hand…
Browse files Browse the repository at this point in the history
…le-aliases
  • Loading branch information
tristanlatr committed Apr 4, 2024
2 parents fe29bb7 + 791da52 commit 7fb204f
Show file tree
Hide file tree
Showing 15 changed files with 1,349 additions and 205 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ pydoctor 22.7.0
* Improve the extensibility of pydoctor (`more infos on extensions <https://pydoctor.readthedocs.io/en/latest/customize.html#use-a-custom-system-class>`_)
* Fix line numbers in reStructuredText xref warnings.
* Add support for `twisted.python.deprecated` (this was originally part of Twisted's customizations).
* Add support for re-exporting it names imported from a wildcard import.
* Add support for re-exporting names imported from a wildcard import.

pydoctor 22.5.1
^^^^^^^^^^^^^^^
Expand Down
5 changes: 4 additions & 1 deletion docs/epytext_demo/demo_epytext_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from abc import ABC
import math
from typing import overload, AnyStr, Dict, Generator, List, Union, Callable, Tuple, TYPE_CHECKING
from typing import overload, AnyStr, Dict, Generator, List, Union, Callable, Tuple, Sequence, Optional, Protocol, TYPE_CHECKING
from somelib import SomeInterface
import zope.interface
import zope.schema
Expand All @@ -32,6 +32,9 @@
This is also a constant, but annotated with typing.Final.
"""

Interface = Protocol
"""Aliases are also documented."""

@deprecated(Version("demo", "NEXT", 0, 0), replacement=math.prod)
def demo_product_deprecated(x, y) -> float: # type: ignore
return float(x * y)
Expand Down
15 changes: 14 additions & 1 deletion docs/restructuredtext_demo/demo_restructuredtext_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import math
import zope.interface
import zope.schema
from typing import overload, Callable, Sequence, Optional, AnyStr, Generator, Union, List, Dict, TYPE_CHECKING
from typing import overload, Protocol, Callable, Sequence, Optional, AnyStr, Generator, Union, List, Dict, TYPE_CHECKING
from incremental import Version
from twisted.python.deprecate import deprecated, deprecatedProperty

Expand All @@ -30,6 +30,9 @@
This is also a constant, but annotated with typing.Final.
"""

Interface = Protocol
"""Aliases are also documented."""

@deprecated(Version("demo", "NEXT", 0, 0), replacement=math.prod)
def demo_product_deprecated(x, y) -> float: # type: ignore
return float(x * y)
Expand Down Expand Up @@ -145,6 +148,7 @@ class DemoClass(ABC, _PrivateClass):
.. versionchanged:: 1.2
Add `read_and_write_delete` property.
"""
#FIXME: For some reason, the alias Demo do ont appear in the class page :/

def __init__(self, one: str, two: bytes) -> None:
"""
Expand Down Expand Up @@ -199,6 +203,12 @@ def read_and_write_delete(self) -> None:
"""
This is a docstring for deleter.
"""
pass

ro = read_only
rw = read_and_write
rwd = read_and_write_delete


class IContact(zope.interface.Interface):
"""
Expand All @@ -215,3 +225,6 @@ class IContact(zope.interface.Interface):

def send_email(text: str) -> None:
pass

_Demo = _PrivateClass
Demo = DemoClass
Loading

0 comments on commit 7fb204f

Please sign in to comment.