Skip to content

MàJ vers Python 3.13#5540

Merged
francoisfreitag merged 3 commits into
masterfrom
ff/py313
Feb 10, 2025
Merged

MàJ vers Python 3.13#5540
francoisfreitag merged 3 commits into
masterfrom
ff/py313

Conversation

@francoisfreitag
Copy link
Copy Markdown
Member

🤔 Pourquoi ?

Rester à jour, aller plus vite, un meilleur debug et plein de trucs chouette !

Class properties are deprecated in Python 3.11 and will not be supported
in Python 3.13
@francoisfreitag francoisfreitag changed the title Upgrade to Python 3.13 MàJ vers Python 3.13 Feb 3, 2025
@francoisfreitag francoisfreitag added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Feb 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 4, 2025

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

Comment thread itou/users/enums.py

@classmethod
@property
def supported_user_kinds(cls):
Copy link
Copy Markdown
Contributor

@tonial tonial Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'était à l'origine du TypeError: 'method' object is not subscriptable ?
Tu as vu pourquoi on avait cette erreur ?

Copy link
Copy Markdown
Member Author

@francoisfreitag francoisfreitag Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui : https://docs.python.org/3/library/functions.html#classmethod

Deprecated since version 3.11, removed in version 3.13: Class methods can no longer wrap other descriptors such as property().

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, désolé, j'ai pas pensé à aller voir le message de commit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Après on pourrait juste rajouter:

class classproperty:
    def __init__(self, func):
        self.fget = func
    def __get__(self, instance, owner):
        return self.fget(owner)

pour ne pas avoir à changer le reste et continuer à avoir des "property" au niveau de la classe...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bof, les properties sur une enum ne me semblent pas trop être l’idée d’une enum. Même si je reconnais que c’est pratique.

@tonial tonial enabled auto-merge February 10, 2025 09:41
@tonial tonial added this pull request to the merge queue Feb 10, 2025
@tonial tonial removed this pull request from the merge queue due to a manual request Feb 10, 2025
@francoisfreitag francoisfreitag added this pull request to the merge queue Feb 10, 2025
Merged via the queue into master with commit 18106de Feb 10, 2025
@francoisfreitag francoisfreitag deleted the ff/py313 branch February 10, 2025 09:57
@francoisfreitag francoisfreitag self-assigned this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC tech

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants