-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
OLD class-customization concept exercise #2350
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
Comments
This issue has been automatically marked as |
closing for rewrite |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue describes how to implement the
class-customization
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:
Goal
This concept exercise is meant to teach an understanding/use of
class-customization
in Python.Learning objectives
more fully understand the uses (and possible abuses) of
classes
in Pythonunderstanding of
class members
understand some of the options that can be used to adapt a
class
for purposes beyond simpleobject
creation, including:@staticmethod
to provide namespaced functionality withoutobject
instantiation.@classmethod
to provide functionality that modifiesclass
attributes shared acrossclass instances
__repr__()
and__str__()
to provide human-readable and understandable class descriptions.using
property()
and@property
to make getters and setters for the methods of aclass
property()
and@property
to "compose" or "calculate" and returninstance attributes
.property()
and@property
to "protect" an attribute from mutation.using
functools.cached_property()
to calculate a property via a method, and the cache it for future calls to the property.Pythons version of "non-public" methods and "private variables" (AKA
Name mangling
)Out of scope
class-inheritance
,multiple-inheritance
,__super()__
, classmixins
class-composition
-- (beyond the composition needed for the decorators in this exercise)dataclasses
decorators
outside of@property
,@staticmethod
, and@classmethod
(the student should already be exposed to the function version of these in a prerequisite)generators
coroutines
descriptors
(these will get their own exercise)class
as a decoratorConcepts
classes
class attributes
class members
class methods
,@classmethod
static methods
,@staticmethod
decorators
getters
&setters
(through the use ofproperty()
and@property
)instance attributes
instance methods
non-public methods
,private variables
, andname-mangling
Prerequisites
These are the concepts/concept exercises the student needs to complete/understand before solving this concept exercise.
basics
booleans
classes
comparisons
decorators
dicts
functions
higher-order-functions
iteration
lists
numbers
sequences
sets
strings
tuples
Resources to refer to
Hints
For more information on writing hints see hints
links.json
For more information, see concept links file
concepts/links.json
file, if it doesn't already exist.links.json
document.Concept Description
Please see the following for more details on these files: concepts & concept exercises
Concept
about.md
Concept file/issue: There is currently no issue or files for the concept. They are TBD.
For more information, see Concept
about.md
Concept
introduction.md
For more information, see Concept
introduction.md
Exercise
introduction.md
For more information, see Exercise
introduction.md
Test-runner
No changes required to the Python Test Runner at this time.
Representer
No changes required to the Python Representer at this time.
Analyzer
No changes required to the Python Analyzer at this time.
Exercise Metadata - Track
For more information on concept exercises and formatting for the Python track
config.json
, please see concept exercise metadata. The trackconfig.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.
79af6c54-c826-4971-833f-2039dd6982bc
Exercise Metadata Files Under
.meta/config.json
For 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.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.
unittest.TestCase
and 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.
The text was updated successfully, but these errors were encountered: