181 Commits

Author SHA1 Message Date
Rapptz
87bc79e6e3 Change certain sequences to use a special proxy type instead of list
This is to speed up cases where someone is just querying the length
of the underlying sequence. If anything else is done to the sequence
then it is copied from the original iterator.

This change should be mostly transparent.
2022-07-19 01:58:58 -04:00
Rapptz
98c4f2ae8b Fix utils.copy_doc being partially unknown 2022-07-19 01:36:18 -04:00
Harshal Laheri
20d3871290
Add return type hint for some functions 2022-07-15 00:15:42 -04:00
James Hilton-Balfe
3433e13848
Prioritise async iteration before sync iteration in utils.find/get 2022-07-07 19:30:21 -04:00
Rapptz
c232631504 Refactor utils.oauth_url slightly 2022-06-13 04:49:32 -04:00
Miku Chan
40f12c8a00
Add state parameter to utils.oauth_url
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-06-13 03:17:43 -04:00
Josh
c9f777c873
Fix type annotations to adhere to latest pyright release 2022-06-12 15:30:45 -04:00
Rapptz
500bf77103 Document and export MISSING sentinel 2022-04-28 07:52:23 -04:00
Bryan Forbes
06c257760b
Update types to use Awaitable where possible 2022-03-30 22:00:24 -04:00
Bryan Forbes
8524bfb54d
Fix caching of UnionType instead of resolved typing.Union 2022-03-28 16:24:03 -04:00
Rapptz
aa18e573c3 Mark MISSING as hashable to allow it to be used in dataclasses in 3.11 2022-03-14 05:45:58 -04:00
Stocker
5aa696ccfa
Fix typing issues and improve typing completeness across the library
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-03-13 23:52:10 -04:00
Rapptz
0ef369c0fa [commands] Automatically unload top level app commands in extensions 2022-03-12 09:24:26 -05:00
Neon Jonn
adb69e7157
Fix some spelling mistakes 2022-03-10 20:45:16 -05:00
Rapptz
56e0c1b3d7 Fix typo in applications.commands scope 2022-03-09 20:26:53 -05:00
Rapptz
8213603822 Change default oauth_url scopes to include application.commands 2022-03-07 18:35:42 -05:00
Rapptz
4c8b1f9abd Remove unused imports 2022-03-05 21:40:42 -05:00
Rapptz
26fc694189 Fix Optional normalisation not working properly 2022-03-01 05:42:44 -05:00
Rapptz
3d0c506124 Fix test_resolve_invite due to changed type 2022-03-01 01:07:13 -05:00
Nadir Chowdhury
3c6279b947
Implement Guild Scheduled Events 2022-03-01 01:00:04 -05:00
Josh
2b69b5d545
Remove discord.InvalidArgument
This uses TypeError and ValueError instead.
2022-02-26 01:44:49 -05:00
Rapptz
8226f0df2c [commands] Require number of parameters at instantiation time
This allows it to bypass annotation evaluation for arguments that don't
matter like self and context.
2022-02-25 10:55:45 -05:00
Rapptz
5589934a59 Fix NameError in utils.get 2022-02-20 11:22:40 -05:00
Rapptz
4f85494c11 Fix Sequence inheritance in 3.8 2022-02-20 08:54:15 -05:00
Rapptz
fbb8a35de6 Relocate and fix versionchanged in find and get 2022-02-20 08:46:20 -05:00
James Hilton-Balfe
eb6f5728e2
Add support for AsyncIterables in find and get 2022-02-20 08:09:17 -05:00
Rapptz
88b520b5ab Reformat code using black
Segments where readability was hampered were fixed by appropriate
format skipping directives. New code should hopefully be black
compatible. The moment they remove the -S option is probably the moment
I stop using black though.
2022-02-20 08:04:58 -05:00
jack1142
dc19c6c7d5
Add positional-only arguments in more places 2022-02-19 20:28:01 -05:00
Rapptz
2c89202214 Fix some minor typing issues 2022-02-17 09:38:12 -05:00
Rapptz
3113036a54 Fix typing for utils.as_chunks 2022-02-17 09:37:58 -05:00
Rapptz
539577a2dd Bring back ParamSpec in utils 2021-08-25 05:30:41 -04:00
Rapptz
4f8e67998a Fix copy_doc typing to not error due to overloaded ParamSpec 2021-08-25 03:41:24 -04:00
James Hilton-Balfe
61abb43b69
Fix type hints for decorators in utils 2021-08-23 05:26:30 -04:00
MrKomodoDragon
73f953eac5
Add missing return type to utils.oauth_url 2021-08-23 05:25:21 -04:00
Rapptz
4a72201617 Make json conversion functions private 2021-08-22 02:35:58 -04:00
James
608e3b5b6c
Rename types.Union -> UnionType for bpo-44732 2021-07-30 21:30:25 -04:00
Vaskel
bc75945088
Add format_dt to utils __all__ 2021-07-21 02:52:06 -04:00
Rapptz
8fb998b599 Refactor utcfromtimestamp to use fromtimestamp(..., tz=utc) 2021-07-09 04:20:45 -04:00
Rapptz
88d825a803 Allow use of orjson instead of json
The difference in speed seems negligible at start up, which is when
most time is taken for actually parsing JSON. I could potentially be
missing something but profiling didn't point to any discernable
difference.
2021-07-07 20:19:17 -04:00
Rapptz
4152819a3c Ignore linting error when accessing Python 3.10 unions 2021-07-04 05:55:29 -04:00
Rapptz
2ce44f7bd6 Add versionadded for format_dt 2021-06-28 03:36:16 -04:00
Rapptz
d1a2ee4620 Add discord.utils.format_dt helper function 2021-06-28 01:31:14 -04:00
Soheab
dbb135b81a
Add disable_guild_select to utils.oauth_url() 2021-06-27 23:37:02 -04:00
Rapptz
fc66c5b92d Fix some webhook related type checker errors 2021-06-10 07:57:41 -04:00
Rapptz
aeb2cfb573 Add private get_slots utility to get slots through MRO 2021-05-28 01:56:48 -04:00
Rapptz
3c90f16bf0 Fix cached_slot_property typings again 2021-05-23 21:30:44 -04:00
Sebastian Law
8bc489dba8
[tasks] Add support for explicit time parameter 2021-05-09 23:27:43 -04:00
Rapptz
de965c2bf5 Simplify SnowflakeList type hints 2021-05-06 08:23:18 -04:00
Josh
3864fb37a0
Fix various reference issues in documentation
Co-Authored-By: Riley Shaw <30989490+ShineyDev@users.noreply.github.com>
2021-05-06 07:51:07 -04:00
Rapptz
7bad27d215 Fix SnowflakeList typings 2021-05-05 23:33:11 -04:00