-
Notifications
You must be signed in to change notification settings - Fork 266
howto/descriptor : correction d'une fuzzy et de qq erreurs #1216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,14 @@ msgstr "" | |
"Project-Id-Version: Python 3\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2019-09-04 11:33+0200\n" | ||
"PO-Revision-Date: 2019-12-12 16:19+0100\n" | ||
"Last-Translator: Julien Palard <[email protected]>\n" | ||
"PO-Revision-Date: 2020-03-28 20:32+0100\n" | ||
"Last-Translator: Mathieu Dupuy <[email protected]>\n" | ||
"Language-Team: FRENCH <[email protected]>\n" | ||
"Language: fr\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 2.1.1\n" | ||
"X-Generator: Poedit 2.3\n" | ||
|
||
#: ../Doc/howto/descriptor.rst:3 | ||
msgid "Descriptor HowTo Guide" | ||
|
@@ -233,13 +233,13 @@ msgid "" | |
"The full C implementation can be found in :c:func:" | ||
"`PyObject_GenericGetAttr()` in :source:`Objects/object.c`." | ||
msgstr "" | ||
"Pour les objets, la machinerie est en :meth:`object.__getattribute__` qui " | ||
"Pour les objets, la machinerie est dans :meth:`object.__getattribute__` qui " | ||
"transforme ``b.x`` en ``type(b).__dict__['x'].__get__(b, type(b)]``. " | ||
"L'implémentation fonctionne à travers une chaîne de priorité qui donne la " | ||
"priorité aux descripteurs de données sur les variables d'instance, la " | ||
"priorité aux variables d'instance sur les descripteurs *non-data*, et " | ||
"attribue la priorité la plus faible à :meth:`__getattr__` si fourni. " | ||
"L'implémentation complète de C peut être trouvée dans :c:func:" | ||
"L'implémentation complète en C peut être trouvée dans :c:func:" | ||
"`PyObject_GenericGetAttr()` dans :source:`Objects/object.c`." | ||
|
||
#: ../Doc/howto/descriptor.rst:99 | ||
|
@@ -250,7 +250,7 @@ msgid "" | |
msgstr "" | ||
"Pour les classes, la machinerie est dans :meth:`type.__getattribute__` qui " | ||
"transforme ``B.x`` en ``B.__dict__['x'].__get__(None, B)``. En Python pur, " | ||
"il ressemble à ::" | ||
"cela ressemble à ::" | ||
|
||
#: ../Doc/howto/descriptor.rst:110 | ||
msgid "The important points to remember are:" | ||
|
@@ -263,7 +263,7 @@ msgstr "les descripteurs sont appelés par la méthode :meth:`__getattribute__`" | |
#: ../Doc/howto/descriptor.rst:113 | ||
msgid "overriding :meth:`__getattribute__` prevents automatic descriptor calls" | ||
msgstr "" | ||
"redéfinition :meth:`__getattribute____` empêche les appels automatiques de " | ||
"redéfinir :meth:`__getattribute____` empêche les appels automatiques de " | ||
"descripteurs" | ||
|
||
#: ../Doc/howto/descriptor.rst:114 | ||
|
@@ -287,7 +287,6 @@ msgstr "" | |
"d'instance." | ||
|
||
#: ../Doc/howto/descriptor.rst:119 | ||
#, fuzzy | ||
msgid "" | ||
"The object returned by ``super()`` also has a custom :meth:" | ||
"`__getattribute__` method for invoking descriptors. The attribute lookup " | ||
|
@@ -297,13 +296,13 @@ msgid "" | |
"not in the dictionary, ``m`` reverts to a search using :meth:`object." | ||
"__getattribute__`." | ||
msgstr "" | ||
"L'objet retourné par ``super()`` a aussi une méthode personnalisée :meth:" | ||
"`__getattribute__` pour appeler les descripteurs. L'appel ``super(B, obj)." | ||
"m()`` recherche ``obj.__class__.__mro__`` pour la classe de base ``A`` " | ||
"immédiatement après ``B`` et renvoie ensuite ``A.__dict__['m'].__get__(obj, " | ||
"B)``. Si ce n'est pas un descripteur, ``m`` est retourné inchangé. Si ce " | ||
"n'est pas dans le dictionnaire, ``m`` renvoie à une recherche avec :meth:" | ||
"`object.__getattribute__`." | ||
"L'objet renvoyé par ``super()`` a également une méthode personnalisée :meth:" | ||
"`__getattribute__` pour invoquer des descripteurs. La recherche d'attribut " | ||
"``super(B, obj).m`` recherche ``obj.__class__.__mro__`` pour la classe de " | ||
"base ``A`` parente directe de ``B`` et renvoie ensuite ``A.__dict__['m']." | ||
"__get__(obj, B)``. Si ce n'est pas un descripteur, ``m`` est renvoyé " | ||
"inchangé. S'il n'est pas dans le dictionnaire, ``m`` se rabat sur une " | ||
"recherche utilisant :meth:`objet.__getattribut__`." | ||
|
||
#: ../Doc/howto/descriptor.rst:126 | ||
msgid "" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Super chaud !
Il me faudrait le code source pour être sûr. Le premier qui trouve publie le lien, merci.
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.
Ouais je crois que j'ai passé 20 minutes entières sur ce seul bloc pour être sûr qu'il ait un sens. Le code source de ?
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.
getattribute renvoyé par super.
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.
Les soulignés ont été remplacés par une mise en gras.
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.
alors ça devrait être ça, bonne chance pour comprendre : https://github.com/python/cpython/blob/016bdd519d76c282bbe0220c67a49226b6262638/Objects/typeobject.c#L7888
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.
Je comprends :
« La recherche d'attribut super(B, obj).m recherche dans obj.class.mro la classe qui suit immédiatement B, appelons la A, et renvoie A.dict['m'].get(obj, B). ».
Et pour la dernière phrase : « S'il n'est pas dans le dictionnaire, trouver
m
se rabat sur … ».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 bien vu. Je corrige ça
Uh oh!
There was an error while loading. Please reload this page.
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.
Je trouve que c'est pas très français, « trouver m se rabat sur une recherche utilisant [...] ». Est-ce qu'une action peut se rabattre ? En même temps, la phrase d'origine en anglais comporte cette maladresse. Que suggères-tu, @christopheNan ?
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.
« S'il n'est pas dans le dictionnaire, la recherche de m revient à une recherche utilisant :meth:
objet.__getattribute__
. »