Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit e15fbf3

Browse files
committed
Trac #31654: docstring improvements
1 parent 3ea7920 commit e15fbf3

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

src/sage/manifolds/differentiable/tensorfield.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,12 +2056,11 @@ def __setitem__(self, args, value):
20562056

20572057
def copy_from(self, other):
20582058
r"""
2059-
Make ``self`` to a copy of ``other``.
2059+
Make ``self`` a copy of ``other``.
20602060
20612061
INPUT:
20622062
2063-
- ``other`` -- other tensor field in the very same module from which
2064-
``self`` should be a copy of
2063+
- ``other`` -- other tensor field, in the same module as ``self``
20652064
20662065
.. NOTE::
20672066
@@ -2107,8 +2106,8 @@ def copy_from(self, other):
21072106
raise ValueError("the components of an immutable element "
21082107
"cannot be changed")
21092108
if other not in self.parent():
2110-
raise TypeError("the original must be an element "
2111-
+ "of {}".format(self.parent()))
2109+
raise TypeError("the original must be an element of "
2110+
f"{self.parent()}")
21122111
self._del_derived()
21132112
self._del_restrictions() # delete restrictions
21142113
name, latex_name = self._name, self._latex_name # keep names

src/sage/manifolds/scalarfield.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,12 +1616,11 @@ def copy(self, name=None, latex_name=None):
16161616

16171617
def copy_from(self, other):
16181618
r"""
1619-
Make ``self`` to a copy of ``other``.
1619+
Make ``self`` a copy of ``other``.
16201620
16211621
INPUT:
16221622
1623-
- ``other`` -- other scalar field in the very same module from which
1624-
``self`` should be a copy of
1623+
- ``other`` -- other scalar field, in the same module as ``self``
16251624
16261625
.. NOTE::
16271626
@@ -1664,8 +1663,8 @@ def copy_from(self, other):
16641663
raise ValueError("the expressions of an immutable element "
16651664
"cannot be changed")
16661665
if other not in self.parent():
1667-
raise TypeError("the original must be an element "
1668-
+ "of {}".format(self.parent()))
1666+
raise TypeError("the original must be an element of "
1667+
f"{self.parent()}")
16691668
self._del_derived()
16701669
for chart, funct in other._express.items():
16711670
self._express[chart] = funct.copy()

src/sage/manifolds/section.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,12 +1646,11 @@ def __setitem__(self, args, value):
16461646

16471647
def copy_from(self, other):
16481648
r"""
1649-
Make ``self`` to a copy from ``other``.
1649+
Make ``self`` a copy of ``other``.
16501650
16511651
INPUT:
16521652
1653-
- ``other`` -- other section in the very same module from which
1654-
``self`` should be a copy of
1653+
- ``other`` -- other section, in the same module as ``self``
16551654
16561655
.. NOTE::
16571656
@@ -1702,8 +1701,8 @@ def copy_from(self, other):
17021701
raise ValueError("the components of an immutable element "
17031702
"cannot be changed")
17041703
if other not in self.parent():
1705-
raise TypeError("the original must be an element "
1706-
+ "of {}".format(self.parent()))
1704+
raise TypeError("the original must be an element of "
1705+
f"{self.parent()}")
17071706
self._del_derived()
17081707
self._del_restrictions() # delete restrictions
17091708
name, latex_name = self._name, self._latex_name # keep names

0 commit comments

Comments
 (0)