Skip to content

Commit a75e7aa

Browse files
committed
Add __bytes__ support to StringList
1 parent 4cd0b4f commit a75e7aa

File tree

7 files changed

+19
-10
lines changed

7 files changed

+19
-10
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ domdf_python_tools
108108
:target: https://github.com/domdfcoding/domdf_python_tools/commit/master
109109
:alt: GitHub last commit
110110

111-
.. |maintained| image:: https://img.shields.io/maintenance/yes/2020
111+
.. |maintained| image:: https://img.shields.io/maintenance/yes/2021
112112
:alt: Maintenance
113113

114114
.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/domdf_python_tools

__pkginfo__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
]
2424

2525
__copyright__ = """
26-
2019-2020 Dominic Davis-Foster <[email protected]>
26+
2019-2021 Dominic Davis-Foster <[email protected]>
2727
"""
2828

2929
__version__ = "2.0.0"

doc-source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
project = "domdf_python_tools"
3232
slug = re.sub(r'\W+', '-', project.lower())
3333
release = version = __version__
34-
copyright = "2019-2020 Dominic Davis-Foster" # pylint: disable=redefined-builtin
34+
copyright = "2019-2021 Dominic Davis-Foster" # pylint: disable=redefined-builtin
3535
language = "en"
3636
package_root = "domdf_python_tools"
3737

doc-source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ domdf_python_tools
111111
:last-commit:
112112
:alt: GitHub last commit
113113

114-
.. |maintained| maintained-shield:: 2020
114+
.. |maintained| maintained-shield:: 2021
115115
:alt: Maintenance
116116

117117
.. |pypi-downloads| pypi-shield::

doc-source/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
autodocsumm>=0.2.0
2-
default-values>=0.2.0
2+
default-values>=0.4.2
33
domdf-sphinx-theme>=0.3.0
44
extras-require>=0.2.0
55
pandas>=1.1.2
6-
seed-intersphinx-mapping>=0.1.1
6+
seed-intersphinx-mapping>=0.3.1
77
sphinx<3.4.0,>=3.0.3
88
sphinx-autofixture>=0.2.1
99
sphinx-copybutton>=0.2.12
1010
sphinx-notfound-page>=0.5
1111
sphinx-prompt>=1.1.0
1212
sphinx-tabs>=1.1.13
13-
sphinx-toolbox>=1.8.2
13+
sphinx-toolbox>=1.8.3
1414
sphinxcontrib-httpdomain>=1.7.0
1515
sphinxemoji>=0.1.6
16-
toctree-plus>=0.0.4
16+
toctree-plus>=0.1.0

domdf_python_tools/stringlist.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:class:`~domdf_python_tools.typing.String` should now be imported from :mod:`domdf_python_tools.typing`.
1010
"""
1111
#
12-
# Copyright © 2020 Dominic Davis-Foster <[email protected]>
12+
# Copyright © 2020-2021 Dominic Davis-Foster <[email protected]>
1313
#
1414
# This program is free software; you can redistribute it and/or modify
1515
# it under the terms of the GNU Lesser General Public License as published by
@@ -356,6 +356,15 @@ def __str__(self) -> str:
356356

357357
return '\n'.join(self)
358358

359+
def __bytes__(self) -> bytes:
360+
"""
361+
Returns the :class:`~domdf_python_tools.stringlist.StringList` as bytes.
362+
363+
.. versionadded:: 2.1.0
364+
"""
365+
366+
return str(self).encode("UTF-8")
367+
359368
def __eq__(self, other) -> bool:
360369
"""
361370
Returns whether the other object is equal to this :class:`~domdf_python_tools.stringlist.StringList`.

repo_helper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
modname: domdf_python_tools
3-
copyright_years: "2019-2020"
3+
copyright_years: "2019-2021"
44
author: "Dominic Davis-Foster"
55
66
version: "2.0.0"

0 commit comments

Comments
 (0)