Rename Field allows the use of the object datamodels names.

Ouverte
#830 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 7 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
Une demi-journée
Accessibilité débutants
45/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
python
Domaine
tooling

Piste de recherche

Start with the Rename Field refactoring, the operation applied to Exemplo.texto in the issue. Reproduce it with the two snippets in the body and confirm the rename turns a class attribute into __new__. The fix should make the rename refuse or skip Python data-model names such as __new__, so the refactored class keeps its original behavior. Done when the reproduction no longer changes the name to a dunder and the type(obj) output stays the same.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug

Rename Field allows the use of the object datamodels names.

Steps to reproduce the behavior:

  1. Code before refactoring:
class Exemplo:
    texto = str

    def __init__(self):
        print("__init__ rodou")

obj = Exemplo()
print(type(obj))
  1. Apply the rename field to Exemplo.texto

  2. Code after refactoring:

class Exemplo:
    __new__ = str

    def __init__(self):
        print("__init__ rodou")

obj = Exemplo()
print(type(obj))
Langage dominant
Python
Étoiles
2.2k
Forks
197
Merge moyen
2 j 13 h
PR mergées (30 j)
5

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de python-rope/rope

Toutes les issues de python-rope/rope

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.