Repository: Rapptz/discord.py

Issue:
Type incorrect for discord.abc.GuildChannel._edit
### Summary

The method `discord.abc.GuildChannel._edit()` wants an `overwrites` parameter with the type of `Dict`. However, this does not match the return type of `discord.abc.GuildChannel.overwrites`.

### Reproduction Steps

I took the mapping returned by `discord.abc.GuildChannel.overwrites`, added a new overwrite, and used it with `discord.TextChannel.edit`. My IDE started complaining about incompatible types.

### Minimal Reproducible Code

```python
guild = bot.get_guild(123)
channel = guild.get_channel(456)
member = guild.get_member(789)
overwrites = channel.overwrites
new_overwrite = discord.PermissionOverwrite()
new_overwrite.ban_members = True
overwrites[member] = new_overwrite
return await channel.edit(overwrites=overwrites)
```


### Expected Results

My IDE to not complain.

### Actual Results

My IDE started complaining:

![Screenshot](https://cdn.discordapp.com/attachments/669155775700271126/869662237038624808/Screen_Shot_2021-07-27_at_3.27.09_PM.png)

### Intents

discord.Intents.all()

### System Information

- Python v3.8.11-final
- discord.py v2.0.0-alpha
    - discord.py pkg_resources: v2.0.0a3407+gfc51736b
- aiohttp v3.7.4.post0
- system info: Darwin 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64


### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

- https://discord.com/channels/336642139381301249/669155775700271126/869662238942834728


Discussion:

Resolving patch:
diff --git a/discord/abc.py b/discord/abc.py
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -473,7 +473,7 @@ def overwrites_for(self, obj: Union[Role, User]) -> PermissionOverwrite:
         return PermissionOverwrite()
 
     @property
-    def overwrites(self) -> Mapping[Union[Role, Member], PermissionOverwrite]:
+    def overwrites(self) -> Dict[Union[Role, Member], PermissionOverwrite]:
         """Returns all of the channel's overwrites.
 
         This is returned as a dictionary where the key contains the target which
@@ -482,7 +482,7 @@ def overwrites(self) -> Mapping[Union[Role, Member], PermissionOverwrite]:
 
         Returns
         --------
-        Mapping[Union[:class:`~discord.Role`, :class:`~discord.Member`], :class:`~discord.PermissionOverwrite`]
+        Dict[Union[:class:`~discord.Role`, :class:`~discord.Member`], :class:`~discord.PermissionOverwrite`]
             The channel's permission overwrites.
         """
         ret = {}
diff --git a/discord/channel.py b/discord/channel.py
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -26,7 +26,7 @@
 
 import time
 import asyncio
-from typing import Any, Callable, Dict, Iterable, List, Optional, TYPE_CHECKING, Tuple, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, TYPE_CHECKING, Tuple, Type, TypeVar, Union, overload
 import datetime
 
 import discord.abc
@@ -251,7 +251,7 @@ async def edit(
         category: Optional[CategoryChannel] = ...,
         slowmode_delay: int = ...,
         type: ChannelType = ...,
-        overwrites: Dict[Union[Role, Member, Snowflake], PermissionOverwrite] = ...,
+        overwrites: Mapping[Union[Role, Member, Snowflake], PermissionOverwrite] = ...,
     ) -> None:
         ...
 
@@ -298,8 +298,8 @@ async def edit(self, *, reason=None, **options):
             is only available to guilds that contain ``NEWS`` in :attr:`Guild.features`.
         reason: Optional[:class:`str`]
             The reason for editing this channel. Shows up on the audit log.
-        overwrites: :class:`dict`
-            A :class:`dict` of target (either a role or a member) to
+        overwrites: :class:`Mapping`
+            A :class:`Mapping` of target (either a role or a member) to
             :class:`PermissionOverwrite` to apply to the channel.
 
         Raises
@@ -930,7 +930,7 @@ async def edit(
         position: int = ...,
         sync_permissions: int = ...,
         category: Optional[CategoryChannel] = ...,
-        overwrites: Dict[Union[Role, Member], PermissionOverwrite] = ...,
+        overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
         rtc_region: Optional[VoiceRegion] = ...,
         video_quality_mode: VideoQualityMode = ...,
         reason: Optional[str] = ...,
@@ -970,8 +970,8 @@ async def edit(self, *, reason=None, **options):
             category.
         reason: Optional[:class:`str`]
             The reason for editing this channel. Shows up on the audit log.
-        overwrites: :class:`dict`
-            A :class:`dict` of target (either a role or a member) to
+        overwrites: :class:`Mapping`
+            A :class:`Mapping` of target (either a role or a member) to
             :class:`PermissionOverwrite` to apply to the channel.
         rtc_region: Optional[:class:`VoiceRegion`]
             The new region for the voice channel's voice communication.
@@ -1193,7 +1193,7 @@ async def edit(
         position: int = ...,
         sync_permissions: int = ...,
         category: Optional[CategoryChannel] = ...,
-        overwrites: Dict[Union[Role, Member], PermissionOverwrite] = ...,
+        overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
         rtc_region: Optional[VoiceRegion] = ...,
         video_quality_mode: VideoQualityMode = ...,
         reason: Optional[str] = ...,
@@ -1229,8 +1229,8 @@ async def edit(self, *, reason=None, **options):
             category.
         reason: Optional[:class:`str`]
             The reason for editing this channel. Shows up on the audit log.
-        overwrites: :class:`dict`
-            A :class:`dict` of target (either a role or a member) to
+        overwrites: :class:`Mapping`
+            A :class:`Mapping` of target (either a role or a member) to
             :class:`PermissionOverwrite` to apply to the channel.
         rtc_region: Optional[:class:`VoiceRegion`]
             The new region for the stage channel's voice communication.
@@ -1337,7 +1337,7 @@ async def edit(
         name: str = ...,
         position: int = ...,
         nsfw: bool = ...,
-        overwrites: Dict[Union[Role, Member], PermissionOverwrite] = ...,
+        overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
         reason: Optional[str] = ...,
     ) -> None:
         ...
@@ -1367,8 +1367,8 @@ async def edit(self, *, reason=None, **options):
             To mark the category as NSFW or not.
         reason: Optional[:class:`str`]
             The reason for editing this category. Shows up on the audit log.
-        overwrites: :class:`dict`
-            A :class:`dict` of target (either a role or a member) to
+        overwrites: :class:`Mapping`
+            A :class:`Mapping` of target (either a role or a member) to
             :class:`PermissionOverwrite` to apply to the channel.
 
         Raises
@@ -1570,7 +1570,7 @@ async def edit(
         sync_permissions: bool = ...,
         category: Optional[CategoryChannel],
         reason: Optional[str],
-        overwrites: Dict[Union[Role, Member], PermissionOverwrite],
+        overwrites: Mapping[Union[Role, Member], PermissionOverwrite],
     ) -> None:
         ...
 
@@ -1602,8 +1602,8 @@ async def edit(self, *, reason=None, **options):
             category.
         reason: Optional[:class:`str`]
             The reason for editing this channel. Shows up on the audit log.
-        overwrites: :class:`dict`
-            A :class:`dict` of target (either a role or a member) to
+        overwrites: :class:`Mapping`
+            A :class:`Mapping` of target (either a role or a member) to
             :class:`PermissionOverwrite` to apply to the channel.
 
             .. versionadded:: 1.3


Test patch: