cours/sources/hypothesis/0SK42 - challenges docstring - 13 août 2023.md
Oscar Plaisant 95c81f9cb3 update
2024-05-14 14:50:12 +02:00

55 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
doc_type: hypothesis-highlights
url: >-
https://osk42.quarto.pub/posts/informatique/docstring%20challenges/docstring%20challenges%20-%2013%20ao%C3%BBt%202023.html
---
author:: [[osk42.quarto.pub]]
url:: [osk42.quarto.pub](https://osk42.quarto.pub/posts/informatique/docstring%20challenges/docstring%20challenges%20-%2013%20ao%C3%BBt%202023.html)
## Annotations
> [!zotero] [2023-08-25 13:30:24](https://hyp.is/yIwatEM6Ee6p5MsYO_LDzw/osk42.quarto.pub/posts/informatique/docstring%20challenges/docstring%20challenges%20-%2013%20ao%C3%BBt%202023.html)
> in"aeiou"for
> > [!note] Annotations
> > Tous les espaces inutiles ont été returés. En général, on sait que l'on a pas besoin de mettre d'espaces autour des opérateur, des `"` et des parenthèses.
> [!zotero] [2023-08-25 13:37:19](https://hyp.is/v77OikM7Ee610a_gupolHw/osk42.quarto.pub/posts/informatique/docstring%20challenges/docstring%20challenges%20-%2013%20ao%C3%BBt%202023.html)
> sum(l in"aeiou"for l in p)
> > [!note] Annotations
> > Il n'est pas nécessaire de mettre des crochets autour de la boucle :
> >
> > ```python
> > sum([l in"aeiou"for l in p])
> > ```
> >
> > Lorsque l'on ne met pas de crochets, mais des parenthèses, la boucle ne va pas créer une liste, mais un [générateur](https://python.doctor/page-iterateurs-iterator-generateur-generator-python).
> >
> > Cela ne change pas le résultat, mais peut éventuellement donner des performances différentes sur un grand nombre de valeurs.
> >
> [!zotero] [2023-08-25 13:37:58](https://hyp.is/1tSwikM7Ee693IMmcZxmpA/osk42.quarto.pub/posts/informatique/docstring%20challenges/docstring%20challenges%20-%2013%20ao%C3%BBt%202023.html)
> certains principes
> > [!note] Annotations
> > Notamment, ici, l'héritage et les objets aggrégateurs.
> [!zotero] [2023-08-25 13:39:16](https://hyp.is/BYq5fkM8Ee6pquMffDjeQQ/osk42.quarto.pub/posts/informatique/docstring%20challenges/docstring%20challenges%20-%2013%20ao%C3%BBt%202023.html)
> Cet objet est un Callable
> > [!note] Annotations
> > On définit un `Callable` en surchargeant la méthode `__call__` dans un objet. Cette méthode a les mêmes arguments que ceux de l'objet créé, et va retourner la valeur que l'objet doit retourner.
> [!zotero] [2023-08-25 13:43:43](https://hyp.is/pKLaCkM8Ee6pq_uURmbtdQ/osk42.quarto.pub/posts/informatique/docstring%20challenges/docstring%20challenges%20-%2013%20ao%C3%BBt%202023.html)
> y nest pas pris en compte
> > [!note] Annotations
> > En anglais, y n'est pas toujours une voyelle. Voici un article qui détaille la question :
> >
> > [The truth about 'Y' : It's mostly a vowel](https://www.merriam-webster.com/grammar/why-y-is-sometimes-a-vowel-usage)
> >
> > On peut également imaginer que cela est un piège posé par le créateur de la question pour détecter ceux qui lisent les consignes trop vite.
## Notes de pages