exercism / v3

The work-in-progress project for developing v3 tracks
https://v3.exercism.io
Other
170 stars 162 forks source link

[Python] Implement new Concept Exercise: Enum #2309

Closed BethanyG closed 4 years ago

BethanyG commented 4 years ago

This issue describes how to implement the Enum 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:

Please also watch the following video:

Goal

The goal of this exercise is to teach the student how Enums (Enumerations) are implemented & used in Python. We will teach this through Pythons Enum class/type.

Learning objectives

Out of scope

Concepts

Prerequisites

Resources to refer to

Hints

Should be focused on basic definition & use, and refer to one or more of the Python related links above (or equivalent/analogous links).

After

Some links and extended discussion of what problems an enumeration type is trying to solve in python programming might be useful to the student here. In particular, the rejected PEP354, and the subsequent accepted PEP435, as well as other discussion and links from the resources section.

It might also be useful to point the student toward all the rich customization options available for enum, such as the "interesting examples" section of the docs.

Finally, some discussion, links and usage around the "out of scope" cases above could be great to encourage the student to explore enums even further.

Representer

TBD

Analyzer

TBD

Implementing

Tests should be written using unittest.TestCase (we try to avoid using PyTest specific features), & the test file shoul dbe named enum_test.py.

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue, and/or reach out on the #python-maintainers channel in the exercism Slack team.

BethanyG commented 4 years ago

@mohanrajanr - all yours! LMK if you have questions or issues.

BethanyG commented 4 years ago

@cmccandless - when you get a chance, if you could give this a quick "sniff test" as a concept/issue & LMK if we need to edit it that would be awesome. Thank you.

mohanrajanr commented 4 years ago

Link to the PR Here: https://github.com/exercism/v3/pull/2312

cmccandless commented 4 years ago

@cmccandless - when you get a chance, if you could give this a quick "sniff test" as a concept/issue & LMK if we need to edit it that would be awesome. Thank you.

My thoughts:

BethanyG commented 4 years ago

Excellent feedback, @cmccandless . Thank you. I went ahead and merged the PR, but will be filing some improvement issues as I go back through our existing exercises and fill in concept docs, re-title, etc. etc. Makes sense to move @unique out, as well as aliases. I think the Functional API, being an alternative and shorter constructor should stay.

And we definitely want the Enum vs enumerate() distinction in the after.md or approaches.md .

BethanyG commented 4 years ago

PR #2312 Has been merged. Closing this issue.