diff --git a/poetry.lock b/poetry.lock index 0e2803c6b..0ed06bef4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -345,7 +345,7 @@ mkdocs = ">=1.1" [[package]] name = "mkdocs-material" -version = "8.3.9" +version = "8.4.1" description = "Documentation that simply works" category = "dev" optional = false diff --git a/src/textual/color.py b/src/textual/color.py index 383ba21c3..200414c2d 100644 --- a/src/textual/color.py +++ b/src/textual/color.py @@ -1,13 +1,10 @@ """ Manages Color in Textual. -All instances where the developer is presented with a color should use this class. The only +All instances where the developer is presented with a color will use this class. The only exception should be when passing things to a Rich renderable, which will need to use the `rich_color` attribute to perform a conversion. -I'm not entirely happy with burdening the user with two similar color classes. In a future -update we might add a protocol to convert automatically so the dev could use them interchangeably. - """ from __future__ import annotations diff --git a/src/textual/geometry.py b/src/textual/geometry.py index 4820edf47..b7c6e535c 100644 --- a/src/textual/geometry.py +++ b/src/textual/geometry.py @@ -357,12 +357,13 @@ class Region(NamedTuple): @property def column_span(self) -> tuple[int, int]: - """Get the start and end column (x coord). + """Get the start and end columns (x coord). The end value is exclusive. Returns: tuple[int, int]: Pair of x coordinates (column numbers). + """ return (self.x, self.x + self.width) @@ -374,6 +375,7 @@ class Region(NamedTuple): Returns: tuple[int, int]: Pair of y coordinates (line numbers). + """ return (self.y, self.y + self.height) @@ -402,7 +404,7 @@ class Region(NamedTuple): """Get the area within the region. Returns: - int: area. + int: Area covered by this region. """ return self.width * self.height diff --git a/src/textual/widget.py b/src/textual/widget.py index f53955e55..83d223710 100644 --- a/src/textual/widget.py +++ b/src/textual/widget.py @@ -12,7 +12,6 @@ from typing import ( ClassVar, Collection, Iterable, - Iterator, NamedTuple, )