-
Notifications
You must be signed in to change notification settings - Fork 33
Correctif n°1 #145
base: master
Are you sure you want to change the base?
Correctif n°1 #145
Conversation
|
||
:pep:`8` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Du coup, expliquez pour les méthodes privées. Vous n'étiez pas loin de la vérité.
Documentation officielle | ||
------------------------- | ||
|
||
https://docs.python.org/3/reference/datamodel.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avec intersphinx.
@@ -1,4 +1,4 @@ | |||
"""Travis est très compliqué.""" | |||
"""Exemple d'utilisation des dunders.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
source/dunders/main.py
Outdated
@@ -44,7 +44,7 @@ def __contains__(self, item): | |||
|
|||
main.ajouter('AsCoeur') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avec un dunder?
258aa99
to
a4caa28
Compare
source/dunders/index.rst
Outdated
@@ -11,24 +11,19 @@ Introduction | |||
|
|||
Le mot dunder est un raccourci de *Double UNDERscore* et représente toutes les méthodes Python qui commencent et finissent par un double underscore (par ex. ``__init__()``). | |||
|
|||
Les dunders sont des méthodes très puissantes et régulièrement utilisées en python. Ce sont des méthodes universelles que toute classe possède (un peu à l'image de la class Object dans Java). | |||
Les dunders sont des méthodes très puissantes et régulièrement utilisées en python. Un dunder est toujours une méthode privée appartenant à une classe. La particularité de ces méthodes et qu'elles ne sont jamais directement appelées mais toujours implicitement ou explicitement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- très puissant, ah?
- privée, ah?
- méthode appartenant à une classe est la définition d'une méthode
- jamais directement appelées mais toujours implicitement ou explicitement 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fatigue + traduction approximative = phrase incorrecte... Mille excuses, je n'aurai pas dû push ces inepties.
J'ai juste une question concernant votre review sur les méthodes privées. Est-ce que vous entendez par là qu'une méthode __myMethod(self) sera privée et (presque) inaccessible hors de sa classe ? Ou il y a quelque chose qui concerne plus les dunders que je suis censé trouvé ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_method
et __method
sont des conventions oui.
_We don't use the term "private" here, since no attribute is really private in Python (without a generally unnecessary amount of work). _
https://www.python.org/dev/peps/pep-0008/#designing-for-inheritance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sinon, pas de problème prenez votre temps et faites tous les pushes que vous voulez. Dites-moi quand vous estimez que c'est bon.
source/dunders/index.rst
Outdated
|
||
|
||
fera appel aux méthodes ``__new__()`` et ``__init__()`` même si ces méthodes n'ont pas été surchargées. | ||
.. todo:: Un peu imprécis car il n'y a pas que des méthodes. ``__name__`` ou ``__file__`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__doc__
etc.
…hon; suppression du paragraphe sur les méthodes privées car erroné; correction des docString des fichiers pythons pour qu'ils reflettent plus ce qu'ils représentent et non mon appréhention de travis
… partie concernant java car j'étais parti sur une mauvaise base. Remplacement par un texte indiquant que les dunders sont privés. Modification de la fonction ajouter de la classe Main pour utiliser un dunder
…rtie sur __name__. Ajout d'un fichier pour compléter __name__. Ajout d'une partie sur les attributs privés.
Ajout du lien vers la documentation officielle de python; suppression du paragraphe sur les méthodes privées car erroné; correction des docString des fichiers pythons pour qu'ils reflettent plus ce qu'ils représentent et non mon appréhention de travis