From e021a59b8789e7cccb2035f90f08411b38b3945e Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 15 Feb 2023 16:27:34 +0000 Subject: [PATCH] python: do not inherit from `object` --- python/pyproject.toml | 2 +- python/src/deltachat/account.py | 2 +- python/src/deltachat/chat.py | 2 +- python/src/deltachat/contact.py | 2 +- python/src/deltachat/message.py | 2 +- python/src/deltachat/provider.py | 2 +- python/src/deltachat/reactions.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 569e849db..580b02535 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -45,7 +45,7 @@ git_describe_command = "git describe --dirty --tags --long --match py-*.*" line-length = 120 [tool.ruff] -select = ["E", "F", "W", "YTT", "C4", "ISC", "ICN", "TID", "DTZ", "PLC", "PLE", "PLW", "PIE", "COM", "UP032"] +select = ["E", "F", "W", "YTT", "C4", "ISC", "ICN", "TID", "DTZ", "PLC", "PLE", "PLW", "PIE", "COM", "UP004", "UP032"] line-length = 120 [tool.isort] diff --git a/python/src/deltachat/account.py b/python/src/deltachat/account.py index e9ec5e311..a1c5b3e52 100644 --- a/python/src/deltachat/account.py +++ b/python/src/deltachat/account.py @@ -53,7 +53,7 @@ def get_dc_info_as_dict(dc_context): return info_dict -class Account(object): +class Account: """Each account is tied to a sqlite database file which is fully managed by the underlying deltachat core library. All public Account methods are meant to be memory-safe and return memory-safe objects. diff --git a/python/src/deltachat/chat.py b/python/src/deltachat/chat.py index 1548829ae..77fac073d 100644 --- a/python/src/deltachat/chat.py +++ b/python/src/deltachat/chat.py @@ -18,7 +18,7 @@ from .cutil import ( from .message import Message -class Chat(object): +class Chat: """Chat object which manages members and through which you can send and retrieve messages. You obtain instances of it through :class:`deltachat.account.Account`. diff --git a/python/src/deltachat/contact.py b/python/src/deltachat/contact.py index fc38cdd73..f317eb315 100644 --- a/python/src/deltachat/contact.py +++ b/python/src/deltachat/contact.py @@ -9,7 +9,7 @@ from .chat import Chat from .cutil import from_dc_charpointer, from_optional_dc_charpointer -class Contact(object): +class Contact: """Delta-Chat Contact. You obtain instances of it through :class:`deltachat.account.Account`. diff --git a/python/src/deltachat/message.py b/python/src/deltachat/message.py index d84713bf8..f0a1cd08b 100644 --- a/python/src/deltachat/message.py +++ b/python/src/deltachat/message.py @@ -12,7 +12,7 @@ from .cutil import as_dc_charpointer, from_dc_charpointer, from_optional_dc_char from .reactions import Reactions -class Message(object): +class Message: """Message object. You obtain instances of it through :class:`deltachat.account.Account` or diff --git a/python/src/deltachat/provider.py b/python/src/deltachat/provider.py index d760dbabb..29313a0fb 100644 --- a/python/src/deltachat/provider.py +++ b/python/src/deltachat/provider.py @@ -8,7 +8,7 @@ class ProviderNotFoundError(Exception): """The provider information was not found.""" -class Provider(object): +class Provider: """ Provider information. diff --git a/python/src/deltachat/reactions.py b/python/src/deltachat/reactions.py index 968bcb0d5..1ab2744d0 100644 --- a/python/src/deltachat/reactions.py +++ b/python/src/deltachat/reactions.py @@ -4,7 +4,7 @@ from .capi import ffi, lib from .cutil import from_dc_charpointer, iter_array -class Reactions(object): +class Reactions: """Reactions object. You obtain instances of it through :class:`deltachat.message.Message`.