Skip to content

OLD Class Inheritance Concept Docs #2972

Closed
@BethanyG

Description

@BethanyG

This issue describes how to implement the class-inheritance concept docs.

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 is meant to teach an understanding/use of class-inheritance in Python.

Learning objectives

  • more fully understand the uses (and possible abuses) of classes in Python
  • understanding and use of single inheritance in Python
  • understanding and use of multiple inheritance in Python
    • the diamond inheritance problem
    • Pythons MRO (method resolution order)
    • pros and cos of mixins () to isolate multiple inheritance issues
  • when and when not to use __super__() to call a parent class constructor

Out of scope

  • class-composition as an explicit topic (it is ok to use limited composition as needed in example code)
  • dataclasses
  • decorators outside of @property, @staticmethod, and @classmethod (the student should already be exposed to these in the prerequisite exercise)
  • generators
  • coroutines
  • descriptors (these will get their own exercise)
  • using a class as a decorator
  • performance considerations

Concepts

  • classes
  • inheritance in OOP
  • single inheritance
  • multiple inheritance
  • minxins
  • __super__()

Prerequisites

These are the concepts/concept exercises the student needs to complete/understand before solving the concept exercise that these concept documents support.

  • basics
  • booleans
  • classes
  • class-customization
  • comparisons
  • decorators
  • dicts
  • functions
  • higher-order-functions
  • iteration
  • lists
  • numbers
  • sequences
  • sets
  • strings
  • tuples

Resources to refer to

  • links.json

    For more information, see concept links file

    • 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 Description

Please see the following for more details on these files: concepts

  • Concept about.md

    For more information, see Concept about.md

    • 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.
  • Concept introduction.md

    For more information, see Concept introduction.md

    • 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.

Implementation Notes

  • Example code should only use syntax & concepts introduced within these docs or one of the prerequisite concept exercises or documents.
    Please do not use comprehensions, generator expressions, or other syntax not previously covered. Please also follow PEP8 guidelines.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    x:rep/largeLarge amount of reputation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions