Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reproduction for mypy 8481
from .user import User as User, ClientUser as ClientUser
from .channel import *
from .message import Message as Message
from . import abc
import abc
from .message import Message
from typing import Optional, Any
from typing_extensions import Protocol, runtime
class GuildChannel: ...
class Messageable(metaclass=abc.ABCMeta):
async def send(
self,
content=None,
*,
tts=False,
embed=None,
file=None,
files=None,
delete_after=None,
nonce=None,
allowed_mentions=None
) -> Message: ...
@runtime
class User(Protocol):
name: str
discriminator: str
avatar: Optional[str]
bot: bool
@property
@abc.abstractmethod
def display_name(self) -> str: ...
@property
@abc.abstractmethod
def mention(self) -> str: ...
import repro.abc
from .message import Message
from .user import BaseUser, User, ClientUser
from typing import Optional, Any, List
class TextChannel(repro.abc.Messageable): ...
class DMChannel(repro.abc.Messageable):
recipient: User
me: ClientUser
def permissions_for(self, user: Optional[BaseUser] = ...) -> Any: ...
class GroupChannel(repro.abc.Messageable):
me: ClientUser
owner: User
def permissions_for(self, user: BaseUser) -> Any: ...
async def add_recipients(self, *recipients: User) -> None: ...
async def remove_recipients(self, *recipients: User) -> None: ...
class CategoryChannel(repro.abc.GuildChannel): ...
from .channel import TextChannel, DMChannel, GroupChannel
from typing import Union
class Message:
channel: Union[TextChannel, DMChannel, GroupChannel]
import repro.abc
from .message import Message
from typing import Optional, Any, List
_BaseUser = repro.abc.User
class BaseUser(_BaseUser):
name: str
discriminator: str
avatar: Optional[str]
bot: bool
@property
def mention(self) -> str: ...
@property
def display_name(self) -> str: ...
class ClientUser(BaseUser):
@property
def friends(self) -> List[User]: ...
@property
def blocked(self) -> List[User]: ...
class User(BaseUser, repro.abc.Messageable): ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.