Skip to content

[Functools] Concept Introduction Docs #2986

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 55 commits into from
Apr 19, 2022
Merged

Conversation

Tarun193
Copy link
Contributor

No description provided.

@github-actions

This comment was marked as resolved.

@BethanyG BethanyG changed the title wrote introduction for functools concept. [Functools Concept]: Introduction Docs Mar 21, 2022
@BethanyG BethanyG changed the title [Functools Concept]: Introduction Docs [Functools] Concept Introduction Docs Mar 21, 2022
@Tarun193
Copy link
Contributor Author

Tarun193 commented Apr 1, 2022

Can someone please review it, and I was not to able to complete this whole task as I am busy in some other work.
But if there is some help required , just ask me out.

@BethanyG
Copy link
Member

BethanyG commented Apr 1, 2022

@Tarun193 - My sincere apologies! I got very bogged down with things and have not gotten to writing the functools docs or reviewing all the PRs I should have. This looks good as a general functools concept introduction.

I was not to able to complete this whole task as I am busy in some other work.

Does this mean you no longer want to work on issue #2366? If that is the case, I will merge this introduction as-is, and un-assign you from the other tasks. When someone picks up the full exercise, they can review and revise this introduction as they complete the other work.

Just let me know - thanks!

@Tarun193
Copy link
Contributor Author

Tarun193 commented Apr 3, 2022

@BethanyG hey, sorry replying late , I just wrote the about document of the concept can you please check it.

@BethanyG
Copy link
Member

BethanyG commented Apr 3, 2022

@Tarun193 -- Thank you for getting a start on the about.md concept doc! I've left a few comments. Before I talk about the content, I just want to give you a few reminders on our Markdown Specifications, and our Writing Style Guide. In particular, you should be using Markdown Reference-Style Links, and making sure that each sentence is on its own line.

My initial comments show an example of each of these techniques. Rather than comment on each formatting or link instance (since these docs are going to need revisions, and re-formatting will add noise), I think it would be cleaner if when you did your next revisions, you rework the remainder of the links and the sentences to conform to the specifications. If you could also update the introduction.md as well, that would be terrific.

Moving on to the content. I want to apologize - decorators (except for the use of @functools.wraps()) should not be part of this exercise nor part of the about.md for functools. Decorators have their own concept exercise and concept docs, which is a prerequisite to this exercise and these concepts. So your section on decorators should be re-worked to only talk about the pros and cons of using @functools.wraps() when writing decorators, rather than introducing decorators as a full topic, or giving examples of how to write one. I have updated the functools exercise spec to reflect this.

Likewise, there is no need to talk about what a higher-order function is, since that will have been covered in the Higher-Order-Functions exercise.

Now for some things that should be included that haven't been included yet.

For functools.partial() we' want to call out the three different "flavors" of objects produced explicitly with some prose as well as code examples. So we want to be specific about what partial.func, partial.args, and partial.keywords are, give clear examples of how using partial() in different ways creates them, and how using them behaves in code. We also want to introduce functools.partialmethod(), and explain what the difference between the two are (one is for use with methods in a class vs a stand-alone function).

Like with functools.partial()and functools.partialmethod, we want to explain how functools.singledispatch() and functools.singledispatchmethod() are the function and method (bound to a class) versions of the same generic function process, and give clear examples of what that looks like in code.

Finally, we want to cover functools.cache(), functools.lru_cache(), and functools.update_wrapper

I have updated the spec and removed @functools.cached_property() (it feels like it belongs to an exercise on class customization instead) and @functools.total.orderg (it belongs with rich comparisons).

I am going to leave my feedback at that for now, and save more in-depth review for after you've added in the additional functions and methods. I've also converted this to a draft PR, so that we can continue to make large revisions without sending out review notifications. I will convert it back into a "regular" PR as we get closer to finalizing things.

Please let me know if you have any questions or issues, and apologies again for the delay in getting you feedback. Thank you for all your hard work on this!

@BethanyG BethanyG marked this pull request as draft April 3, 2022 18:05
BethanyG and others added 10 commits April 5, 2022 17:12
General hints do not appear to support either reflink nor nested bullets, so I re-arranged the file to omit them.
Bumps [actions/stale](https://git.1-hub.cnactions/stale) from 4 to 5.
- [Release notes](https://git.1-hub.cnactions/stale/releases)
- [Changelog](https://git.1-hub.cnactions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v4...v5)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@Tarun193
Copy link
Contributor Author

Sorry for not replying.
Hey I just updated the about and introduction file according to the new requirements of the concept.
@BethanyG can you please check it.

@Tarun193 Tarun193 marked this pull request as ready for review April 16, 2022 09:15
So that they're consistent with proper function spacing of 2 lines
Metallifax and others added 27 commits April 16, 2022 18:58
added module level docstring in stub and exemplar (both files).

various whitespace and tabbing issues cleaned up (both).

added types to all docstring return and param lines (both).

added some periods to docstring descriptions.

brought the example portion of letter_grades docstring to exemplar
added module level docstrings to both stub and exemplar (both files).

added summary first line docstrings (both).

converted the 'tuple' types to tuple syntax with nested
types in param and return lines in docstrings
(not attached,  its consistent with other concepts were altered though)

added periods at the end of some descriptions (both).

removed some extra whitespaces (both)

added a newline on line 42 in exemplar

grammar fix on line 50 in stub, line 55 in exemplar

changed the return line of 'compare_records' docstring to start
with lowercase letter (both)
added module level docstring to both stub and exmplar (both files).

added summary first line docstrings to each function (both).

removed whitespace on lines 8, 19, 30, 41 in stub

 removed whitespace on lines 8, 21, 35, 49  in exemplar.
added a module level docstring to both stub and exemplar (both files)

added summary first line docstrings to all (both).

added dashes and periods to return/param line descriptions. (both)

added missing param and return line descriptions to docstrings (both)

cleaned up the 'intersection' param docstrings -- the long list
of constant var names was moved to the additional notes section (both)

removed various extra whitespaces (both)

'singleton_ingredients' dishes & intersection params swapped places
(both)

newline on line 104 in stub

newline on line 124 in exemplar
per title, tuples as types looked very messy so they were reverted to
just "tuples" in docstring types

added hints in regards to how to format the multiline strings (clean_up)
felt it was more succinct to just use 'number' as type since
integer or float is given in the description, also looked messier.
on line 22 in stub and line 31 in exemplar
'str' after the dash, line 17 in stub and exemplar.

made the module level docstring more detailed.
per title, reverting the list type changes so
docstrings are easier to read in both stub and exemplar (both)

missing types and dashes in `perfect_score` (both)
both files return statement simplified (both stub and exemplar).
shorted param and return descriptions and made types more intuitive

shuffled the additional notes in fail_safe

modified the module level docstring
Added examples to make_word_groups and and adjective_to_word functions

Various grammar changes and word swaps.
Committing the caiter-waiter exemplar.py changes.
The first part of the exercise consist on defining a constant. In the instructions there is an example where the the constant is called as follows:
>>> lasagna.EXPECTED_BAKE_TIME
I believe that the constant was probably an atribute from the lasagna class in an earlier version of the problem, and now it just makes it difficult to anderstand what "lasagna" means in the exercise.


Added import lines to the exercise examples. Two types of imports are used; the complete module for the constant and just the functions for the three functions of the example.
…into pr/2986"

This reverts commit 9395697, reversing
changes made to 6912c86.
Copy link
Member

@BethanyG BethanyG left a comment

Choose a reason for hiding this comment

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

Hi @Tarun193 👋🏽

Thanks for updating this with the new requirements. I really appreciate it.

Since the comments on this PR are getting quite long and noisy, I am going to approve this as-is and optimistically merge it. Should you want to continue working on it more, we can pick up discussions in a follow-on PR. Let me know if you have any questions or issues.

@BethanyG BethanyG merged commit 5b2c321 into exercism:main Apr 19, 2022
@Tarun193
Copy link
Contributor Author

Hi @BethanyG 👋
thanks for your appreciation.
No I don't want to work on it any more as the about section is good enough according to me and I don't have idea for exercise.
But if you want some some improvements feel free ask me. I will do it as per suggestions.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants