Title: Use @abstractmethod inside of abstract classes · Issue #1837 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: Use @abstractmethod inside of abstract classes · Issue #1837 · python-telegram-bot/python-telegram-bot
X Title: Use @abstractmethod inside of abstract classes · Issue #1837 · python-telegram-bot/python-telegram-bot
Description: $ grep NotImplementedError -r telegram --exclude-dir=vendor -I --line-number ./telegram/ext/handler.py: raise NotImplementedError ./telegram/ext/basepersistence.py: raise NotImplementedError ./telegram/ext/basepersistence.py: raise NotIm...
Open Graph Description: $ grep NotImplementedError -r telegram --exclude-dir=vendor -I --line-number ./telegram/ext/handler.py: raise NotImplementedError ./telegram/ext/basepersistence.py: raise NotImplementedError ./tele...
X Description: $ grep NotImplementedError -r telegram --exclude-dir=vendor -I --line-number ./telegram/ext/handler.py: raise NotImplementedError ./telegram/ext/basepersistence.py: raise NotImplementedError ./tele...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/1837
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use @abstractmethod inside of abstract classes","articleBody":"```console\r\n$ grep NotImplementedError -r telegram --exclude-dir=vendor -I --line-number\r\n./telegram/ext/handler.py: raise NotImplementedError\r\n./telegram/ext/basepersistence.py: raise NotImplementedError\r\n./telegram/ext/basepersistence.py: raise NotImplementedError\r\n./telegram/ext/basepersistence.py: raise NotImplementedError\r\n./telegram/ext/basepersistence.py: raise NotImplementedError\r\n./telegram/ext/basepersistence.py: raise NotImplementedError\r\n./telegram/ext/basepersistence.py: raise NotImplementedError\r\n./telegram/ext/basepersistence.py: raise NotImplementedError\r\n./telegram/ext/basepersistence.py: raise NotImplementedError\r\n./telegram/ext/filters.py: raise NotImplementedError\r\n```\r\n\r\nWhilst looking through the code I noticed a few occurrences where the docstring states that methods must be overwritten/implemented und corresponding checks are apparently in the tests. However Python provides the `@abstractmethod` decorator which we could use. We could either use the `ABCMeta` metaclass for this or I could implement this into the *Python3 only* branch where we could simple inherit `ABC`.\r\nI think this change would make the code a bit more clear and prevents common pitfalls where one wants to inherit such classes but forgets to implement these methods (probably most common with `BasePersistence`)","author":{"url":"https://github.com/septatrix","@type":"Person","name":"septatrix"},"datePublished":"2020-03-19T16:20:43Z","url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/1837"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b7062f20-5dfa-7b60-7cf4-f9542ffbbaea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAB6:323204:25B64F1:317FD6B:6B025DF6 |
| html-safe-nonce | d93aade8a2aaf96d514037df28a83b776827e9f64e674c4f8b293805ceda9583 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUI2OjMyMzIwNDoyNUI2NEYxOjMxN0ZENkI6NkIwMjVERjYiLCJ2aXNpdG9yX2lkIjoiMzM4OTIwNTU0MDI3NzIxNDcxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f28825ca4558b61c5d4c031f143c34f6be80001e629947f433e32ed916f73bfc |
| hovercard-subject-tag | issue:584533441 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-telegram-bot/python-telegram-bot/1837/issue_layout |
| twitter:image | https://opengraph.githubassets.com/127a02718a53db841720e7623b3a3a54863a9dc438429574aa3a213c4013fb73/python-telegram-bot/python-telegram-bot/issues/1837 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/127a02718a53db841720e7623b3a3a54863a9dc438429574aa3a213c4013fb73/python-telegram-bot/python-telegram-bot/issues/1837 |
| og:image:alt | $ grep NotImplementedError -r telegram --exclude-dir=vendor -I --line-number ./telegram/ext/handler.py: raise NotImplementedError ./telegram/ext/basepersistence.py: raise NotImplementedError ./tele... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | septatrix |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git |
| octolytics-dimension-user_id | 16178365 |
| octolytics-dimension-user_login | python-telegram-bot |
| octolytics-dimension-repository_id | 38696925 |
| octolytics-dimension-repository_nwo | python-telegram-bot/python-telegram-bot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38696925 |
| octolytics-dimension-repository_network_root_nwo | python-telegram-bot/python-telegram-bot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width