diff options
author | mathieui <mathieui@mathieui.net> | 2021-02-03 21:45:58 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-02-03 21:53:43 +0100 |
commit | a16792e9905014d8c6e57c614483c321cc99a9b0 (patch) | |
tree | 920df5776e6e0c4604d7add50f84f7f06e632938 /slixmpp/basexmpp.py | |
parent | 6448d09c307bd0a2589893ee759c66f10119ea2c (diff) | |
download | slixmpp-a16792e9905014d8c6e57c614483c321cc99a9b0.tar.gz slixmpp-a16792e9905014d8c6e57c614483c321cc99a9b0.tar.bz2 slixmpp-a16792e9905014d8c6e57c614483c321cc99a9b0.tar.xz slixmpp-a16792e9905014d8c6e57c614483c321cc99a9b0.zip |
basexmpp: type self.plugins in a more useful manner
Diffstat (limited to 'slixmpp/basexmpp.py')
-rw-r--r-- | slixmpp/basexmpp.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/slixmpp/basexmpp.py b/slixmpp/basexmpp.py index 02c0b21c..47633d8f 100644 --- a/slixmpp/basexmpp.py +++ b/slixmpp/basexmpp.py @@ -11,10 +11,15 @@ :copyright: (c) 2011 Nathanael C. Fritz :license: MIT, see LICENSE for more details """ +from __future__ import annotations import asyncio import logging +from typing import ( + TYPE_CHECKING, +) + from slixmpp import plugins, roster, stanza from slixmpp.api import APIRegistry from slixmpp.exceptions import IqError, IqTimeout @@ -33,6 +38,11 @@ from slixmpp.plugins import PluginManager, load_plugin log = logging.getLogger(__name__) + +if TYPE_CHECKING: + from slixmpp.types import PluginsDict + + class BaseXMPP(XMLStream): """ @@ -44,6 +54,10 @@ class BaseXMPP(XMLStream): is used during initialization. """ + # This is technically not correct, but much more useful to typecheck + # than the internal use of the PluginManager API + plugin: PluginsDict + def __init__(self, jid='', default_ns='jabber:client', **kwargs): XMLStream.__init__(self, **kwargs) |