Skip to content

Commit bc72380

Browse files
committed
include documented special methods with sphinx, correct some docstrings
1 parent 148445f commit bc72380

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

doc/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@
300300
# Use type annotations for documenting the return type.
301301
napoleon_use_rtype = False
302302

303+
# Include documented special methods.
304+
napoleon_include_special_with_doc = True
305+
303306
# Example configuration for intersphinx: refer to the Python standard library.
304307
intersphinx_mapping = {'https://docs.python.org/': None}
305308

pyformlang/cfg/formal_grammar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def to_text(self) -> str:
154154
def from_text(
155155
cls: Type[GrammarT],
156156
text: str,
157-
start_symbol: Optional[Hashable] = Variable("S")) \
157+
start_symbol: Optional[Hashable] = "S") \
158158
-> GrammarT:
159159
"""Read a grammar from the given text.
160160

pyformlang/objects/base_epsilon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self) -> None:
2121
super().__init__("epsilon")
2222

2323
def __eq__(self, other: Any) -> bool:
24-
"""Check if the epsilon is equal to the given object."""
24+
"""Checks if the epsilon is equal to the given object."""
2525
return isinstance(other, BaseEpsilon) \
2626
or not isinstance(other, FormalObject) and other in EPSILON_SYMBOLS
2727

pyformlang/objects/formal_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __eq__(self, other: Any) -> bool:
3636
return self._is_equal_to(other) and other._is_equal_to(self)
3737

3838
def __hash__(self) -> int:
39-
"""Gets the hash current formal object."""
39+
"""Gets the hash of current formal object."""
4040
if self._hash is None:
4141
self._hash = hash(self._value)
4242
return self._hash

0 commit comments

Comments
 (0)