Discord.py: PEP 614

Created on 10 Oct 2020  路  13Comments  路  Source: Rapptz/discord.py

The Problem


Checking if at least one of checks passes

The Ideal Solution


PEP 614 (implemented in Python 3.9) relaxes decorator syntax, allowing writing things like

@check1 | check2
async def cmd(ctx):
    pass

The Current Solution

@check_any(check1, check2)
async def cmd(ctx):
    pass

Summary


Implement __or__ for all callables returned from check

feature request

Most helpful comment

3.9 is not the minimum version for the library.

But that won't break code on lower versions

All 13 comments

This is not good. Also the PEP 614 just relaxes grammar and 3.9 is not the minimum version for the library.

3.9 is not the minimum version for the library.

But that won't break code on lower versions

And why is it not good?

Agreed. Implementing __or__ won't hurt Python 3.8- users, but definitely would benefit 3.9+ users.

Agreed. Implementing __or__ won't hurt Python 3.8- users, but definitely would benefit 3.9+ users.

It needs to not hurt Python 3.5.3 users which is the lowest requirement for discord.py

Agreed. Implementing __or__ won't hurt Python 3.8- users, but definitely would benefit 3.9+ users.

It needs to not hurt Python 3.5.3 users which is the lowest requirement for discord.py

I don't see how can it hurt them. Also Python 3.5 itself is not supported.

I personally do not agree with this change, the proposed syntax is no better than the current option.

A lot of people will find it more intuitive

It needs to not hurt Python 3.5.3 users which is the lowest requirement for discord.py

I don't see how can it hurt them. Also Python 3.5 itself is not supported.

At https://github.com/Rapptz/discord.py#installing it says that 3.5.3 or higher is supported, so your statement isn't true at all.

It needs to not hurt Python 3.5.3 users which is the lowest requirement for discord.py

I don't see how can it hurt them. Also Python 3.5 itself is not supported.

At https://github.com/Rapptz/discord.py#installing it says that 3.5.3 or higher is supported, so your statement isn't true at all.

Which of them?

  1. I tried using a library with a fix on Python 3.5, it did work
  2. Python 3.5 reached end of life on 30/09/2020

Danny has stated on multiple occasions that he doesn't care about official EOL dates and will continue to support older versions until it becomes infeasible to do so.

Danny has stated on multiple occasions that he doesn't care about official EOL dates and will continue to support older versions until it becomes infeasible to do so.

3.5 still won't break

The fact that it doesn't break previous versions is irrelevant if the library maintainer doesn't want the syntax to be used.

The fact that this issue is closed should speak volumes. Feel free to fork the library and implement whatever syntax support you desire, after all, it is open source.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ThePiGuy24 picture ThePiGuy24  路  17Comments

SakiiR picture SakiiR  路  17Comments

johndoe434 picture johndoe434  路  21Comments

Mercurial picture Mercurial  路  22Comments

ams2990 picture ams2990  路  14Comments