From 696a9dcc2e93dc0fccaed1a99a18339a77ca98c7 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Thu, 30 Nov 2023 20:10:19 +0100 Subject: [PATCH] Add type hints for App and User --- toot/__init__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/toot/__init__.py b/toot/__init__.py index 9889d57..43f19a4 100644 --- a/toot/__init__.py +++ b/toot/__init__.py @@ -2,12 +2,23 @@ import os import sys from os.path import join, expanduser -from collections import namedtuple +from typing import NamedTuple __version__ = '0.39.0' -App = namedtuple('App', ['instance', 'base_url', 'client_id', 'client_secret']) -User = namedtuple('User', ['instance', 'username', 'access_token']) + +class App(NamedTuple): + instance: str + base_url: str + client_id: str + client_secret: str + + +class User(NamedTuple): + instance: str + username: str + access_token: str + DEFAULT_INSTANCE = 'https://mastodon.social'