You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue describes how to implement the functools concept exercise for the python track.
Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
This concept exercise is meant to teach an understanding/use of functools (e.g, the functools module) in Python.
Learning objectives
Learn more about the functional tools the Python Standard Library provides through the functools module.
Build and understanding of and use the following methods and decorators from the module:
functools.partial()
partial.func
partial.args
partial.keywords
functools.update_wrapper()
functools.cache()
@functools.cached_property() (this seems better in class_customization)
@functools.lru_cache()
@functools.total_ordering (this method seems more appropriate in the rich comparisons exercise)
@functools.singledispatch
@<function>.register()
@functools.wraps()
classfunctools.partialmethod()
classfunctools.singledispatchmethod()
Out of scope
classes & class customization beyond the direct use of the class methods in this module.
You can refer to one or more of the resources linked above, or analogous resources from a trusted source. We prefer using links within the Python Docs as the primary go-to, but other resources listed above are also good. Please try to avoid paid or subscription-based links if possible.
The same resources listed in this issue can be used as a starting point for the concepts/links.json file, if it doesn't already exist.
If there are particularly good/interesting information sources for this concept that extend or supplement the concept exercise material & the resources already listed -- please add them to the links.json document.
Concept file/issue: The working copy of these files can be found here: functools docs. These may need editing to match the exercise writers needs/style.
This file provides information about this concept for a student who has completed the corresponding concept exercise. It is intended as a reference for continued learning.
This can also be a summary/paraphrase of the document listed above, and will provide a brief introduction of the concept for a student who has not yet completed the concept exercise. It should contain a good summation of the concept, but not go into lots of detail.
This should also summarize/paraphrase the above document, but with enough information and examples for the student to complete the tasks outlined in this concept exercise.
Exercise Metadata - Track
For more information on concept exercises and formatting for the Python track config.json , please see concept exercise metadata. The track config.json file can be found in the root of the Python repo.
You can use the below for the exercise UUID. You can also generate a new one via exercism configlet, uuidgenerator.net, or any other favorite method. The UUID must be a valid V4 UUID.
Exercise UUID : ``
concepts should be filled in from the Concepts section in this issue
prerequisites should be filled in from the Prerequisites section in this issue
.meta/config.json - see this link for the fields and formatting of this file.
.meta/design.md - see this link for the formatting of this file. Please use the Goal, Learning Objectives,Concepts, Prerequisites and , Out of Scope sections from this issue.
Implementation Notes
Code in the .meta/examplar.py file should only use syntax & concepts introduced in this exercise or one of its prerequisite exercises.
Please do not use comprehensions, generator expressions, or other syntax not previously covered. Please also follow PEP8 guidelines.
In General, tests should be written using unittest.TestCase and the test file should be named <EXERCISE-NAME>_test.py.
While we do use PyTest as our test runner and for some implementation tests, please check with a maintainer before using a PyTest test method, fixture, or feature.
Our markdown and JSON files are checked against prettier . We recommend setting prettier up locally and running it prior to submitting your PR to avoid any CI errors.
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue, or contact one of the maintainers on our Slack channel.
This issue describes how to implement the
functoolsconcept exercise for the python track.Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Goal
This concept exercise is meant to teach an understanding/use of
functools(e.g, thefunctools module) in Python.Learning objectives
Learn more about the functional tools the Python Standard Library provides through the
functoolsmodule.Build and understanding of and use the following methods and decorators from the module:
functools.partial()partial.funcpartial.argspartial.keywordsfunctools.update_wrapper()functools.cache()(this seems better in@functools.cached_property()class_customization)@functools.lru_cache()(this method seems more appropriate in the@functools.total_orderingrich comparisonsexercise)@functools.singledispatch@<function>.register()@functools.wraps()functools.partialmethod()functools.singledispatchmethod()Out of scope
classes&class customizationbeyond the direct use of the class methods in this module.comprehensionscomprehensionsinlambdasdecorators(these have their own exercise. See issue OLD decorators concept exercise #2356 )map(),filter()orfunctools.reduce()in acomprehensionfunctools.reduce()(this was already covered withmap()andfilter())generatorsassignment expressionor "walrus" operator (:=) in alambdaenumsConcepts
functoolsmodulegeneric functionsdecoratorshigher-order functionspartial objectsin python/partial evaluationin pythonsingle dispatchPrerequisites
These are the concepts/concept exercises the student needs to complete/understand before solving this concept exercise.
basicsboolsclassesclass-customizationclass-componentscomparisonsrich-comparisonsdecoratorsdescriptorsdictsdict-methodsfunctionsfunction-argumentshigher-order-functionsiterationlistslist-methodsnumberssequencessetsstringsstring-methodstuplesResources to refer to
functools- Tools for Maniputlating Fuctionsmap()&filter()any()&all()min()&max()sum()Hints
For more information on writing hints see hints
links.jsonFor more information, see concept links file
concepts/links.jsonfile, if it doesn't already exist.links.jsondocument.Concept Description
Please see the following for more details on these files: concepts & concept exercises
Concept
about.mdConcept file/issue: The working copy of these files can be found here: functools docs. These may need editing to match the exercise writers needs/style.
For more information, see Concept
about.mdConcept
introduction.mdFor more information, see Concept
introduction.mdExercise
introduction.mdFor more information, see Exercise
introduction.mdExercise Metadata - Track
For more information on concept exercises and formatting for the Python track
config.json, please see concept exercise metadata. The trackconfig.jsonfile can be found in the root of the Python repo.You can use the below for the exercise UUID. You can also generate a new one via exercism configlet, uuidgenerator.net, or any other favorite method. The UUID must be a valid V4 UUID.
Exercise Metadata Files Under
.meta/config.jsonFor more information on exercise
.meta/files and formatting, see concept exercise metadata files.meta/config.json- see this link for the fields and formatting of this file..meta/design.md- see this link for the formatting of this file. Please use the Goal, Learning Objectives,Concepts, Prerequisites and , Out of Scope sections from this issue.Implementation Notes
.meta/examplar.pyfile should only use syntax & concepts introduced in this exercise or one of its prerequisite exercises.unittest.TestCaseand the test file should be named<EXERCISE-NAME>_test.py.Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue, or contact one of the maintainers on our Slack channel.