Closed BethanyG closed 12 months ago
Hello;
I am working on this, so if you can label it as [claimed]
and assign it to me will be 👌.
I was thinking about adding some class diagrams to introduction.md
, I would like to ask if there is any style guideline to follow regarding graphics. Just to fit the looks of it to the rest of the page.
Hi @Guillermo-N 👋🏽
Apologies for the delay - I've assigned this issue to you. Thanks so much for taking it on! ✨
I was thinking about adding some class diagrams to introduction.md, I would like to ask if there is any style guideline to follow regarding graphics. Just to fit the looks of it to the rest of the page.
We really don't have a style guide for graphics. In the past (due to exercises being downloadable to a students machine), we largely shied away from graphics. So the overarching advice is to make sure that you don't solely rely on graphics to explain things, since you can't be confident that a student who has downloaded the exercise can see them. If the student has an IDE that will render a Markdown preview, they will show up in the instruction text. Otherwise, they will show as links to the GitHub repo where they are stored (more on that below). Here are some other things off the top of my head that I'd recommend:
svgs
, since they'll resize much nicer in mobile and smaller-screen context.For the graphics you do include, you should upload/PR them to the V3 files repo. Once they are approved and merged there, you can link to them in your documentation here. If a graphic is approaching 1MB in size or bigger, you'll want to use the GitHub LFS system to upload them to the repo. More info on that here: https://git-lfs.github.com/
For the graphics I've included (see this exercise instructions append and the exercise hints file), I have used mermaid JS, and then saved the diagram out as SVG which worked fairly well. VS Code has extensions that can help with that process.
You can also reach out on our forum and one of the friendly community members there would be glad to help -- or you can also ping me here on GitHub, should you have more questions or issues.
That is true, I didn't thought about the Markdown not be render. Because the graphics are simple I will try to do them in ASCII.
That should be okay, right?
Just submitted what I think can be the a first revision.
Hello @BethanyG;
Any updates or tips about what to change on the code I did summited?
@Guillermo-N
Hi. 🙂 Apologies for the delay in getting back to you. Unfortunately, your submission came in as we were closing this repo to contributions, and putting things on pause. You can read more about that decision here. While I'd be happy to reevaluate things in a couple of months, I am not going to be able to review your PR right now, and will be closing it with a message. I am very sorry to have to do this to you, but we do not (right now) have the bandwidth to work on this concept exercise, and need to focus on other exercises and fixes that are higher priority.
This issue describes how to implement the
class-inheritance
concept exercise concept exercise for the Python track. The related concept documents improvement issue can be found here.✅ Getting started
If you have not yet created or contributed to a concept exercise, this issue will require some upfront reading to give you the needed background knowledge. Some good example exercises to look at in the repo:
💡Example Exercises💡
1. [Little Sister's Vocabulary](https://github.com/exercism/python/tree/main/exercises/concept/little-sisters-vocab) 2. [Meltdown Mitigation](https://github.com/exercism/python/tree/main/exercises/concept/meltdown-mitigation) 3. [Making the Grade](https://github.com/exercism/python/tree/main/exercises/concept/making-the-grade) 4. [Ellen's Alien Game](https://github.com/exercism/python/tree/main/exercises/concept/ellens-alien-game)
We also recommend completing one or more of the concept exercises (they're called "learning exercises") on the website.
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 go through the following documents:General Contributing Docs:
Documents on Language Tracks and Concept Exercises
🎯 Goal
This concept exercise is meant to teach an understanding/use of
class-inheritance
in Python.💡Learning objectives
classes
in Pythonsingle inheritance
in Pythonmultiple inheritance
in Pythonmixins
() to isolatemultiple inheritance
issuessuper()
to call a parentclass
constructor or method🤔 Concepts
classes
inheritance
inOOP
single inheritance
multiple inheritance
minxins
super()
🚫 Topics that are Out of scope
Concepts & Subjects that are Out of Scope (click to expand)
- `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
↩️ Prerequisites
These are the concepts/concept exercises the student should be familiar with before taking on/learning this concept.
Prereqs (click to expand)
- `basics` - `booleans` - `classes` - `class-customization` - `comparisons` - `decorators` - `dicts` - `functions` - `higher-order-functions` - `iteration` - `lists` - `numbers` - `sequences` - `sets` - `strings` - `tuples`📚 Resources for Writing and Reference
Resources (click to expand)
- [classes (Python tutorial)](https://docs.python.org/3/tutorial/classes.html) - [Real Python: Object-Oriented Programming in Python 3](https://realpython.com/python3-object-oriented-programming/) - [Real Python: Inheritance and Composition: A Python OOP Guide](https://realpython.com/inheritance-composition-python/) - [Towards DataScience: Understand Inheritance in Python](https://towardsdatascience.com/understand-inheritance-in-python-74f8e3025f3c) -- (_this is not a good resource for hints or links, since it requires an account signup_) - [Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle) - [Multiple Inheritance in Python](https://www.python-course.eu/python3_multiple_inheritance.php) - [Multiple Inheritance is Hard (Ned Batchelder)](https://nedbatchelder.com/blog/201210/multiple_inheritance_is_hard.html) - [Python.org: MRO in Python 2.3+](https://www.python.org/download/releases/2.3/mro/) - [Dig into Python super() and MRO](https://gaopinghuang0.github.io/2018/12/29/dig-into-python-super-and-mro) - [Multiple inheritance and mixin classes in Python](https://www.thedigitalcatonline.com/blog/2020/03/27/mixin-classes-in-python/) - [Making Python classes more modular using mixins](https://www.residentmar.io/2019/07/07/python-mixins.html) - [Write composable, reusable Python classes using Mixinsl)](https://dev.to/bikramjeetsingh/write-composable-reusable-python-classes-using-mixins-6lj) - [Mixins in Python and Ruby Compared](https://andrewbrookins.com/technology/mixins-in-python-and-ruby-compared/) - [Python Data Model - Python Docs](https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy)
Exercise Ideas & Stories
Should you need inspiration for an exercise story, you can find a collection here. You can also port an exercise from another track, but please make sure to only to include tasks that actually make sense in Python and that add value for a student. Remove/replace/add tasks as needed to make the concept clear/workable.
📁 Exercise Files to Be Created
File Detail for this Exercise
* ### Exercise `introduction.md` For more information, see [**Exercise** `introduction.md`](https://github.com/exercism/docs/blob/main/building/tracks/concept-exercises.md#file-docsintroductionmd) - This can summarize/paraphrase the linked concept documents if they have already been created (either the `about` or the `introduction`). The summary does need to have enough information and examples for the student to complete all the tasks outlined for this concept exercise. * ### Exercise `instructions.md` For more information, see [`instructions.md`](https://github.com/exercism/docs/blob/main/building/tracks/concept-exercises.md#file-docsinstructionsmd) Instructions for an exercise usually center on a story that sets up the code challenge to be solved. You can create your own story, or fork one from the ones listed [here](https://exercism.org/docs/building/tracks/stories). Please make sure to give credit to the original authors if you use a story or fork an exercise. * ### Exercise `Exemplar.py` Solution For more information, see [exemplar implementation](https://github.com/exercism/docs/blob/main/building/tracks/concept-exercises.md#file-exemplar-implementation). This file should not use syntax or datas structures not introduced in this exercise or in this exercise's prerequisites. It will be used as an "ideal" solution for the challenge, so make sure it conforms to PEP8 and other formatting conventions, and **does not use single letter variable names**. It should also include proper module and function-level docstrings. However, it should **NOT** include typehinting or type aliases. * ### `
♾️ Exercise Metadata - Track
For more information on concept exercises and formatting for the Python track
config.json
, please seeconfig.json
. 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.
🎶 Implementation Notes
As a reminder, code in the
.meta/examplar.py
file should only use syntax & concepts introduced in this exercise or one of its prerequisite exercises. We run all ourexamplar.py
files through PyLint, but do not strictly require module docstrings. We do require function docstrings similar to PEP257. See this concept exerciseexemplar.py
for an example.Please do not use comprehensions, generator expressions, or other syntax not previously covered either in the introduction to this exercise, or to one of its prerequisites. 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
.PyTest custom mark
to link test cases to exercise task numbers.unittest.subtest
to parameterize test input where/when needed. Here is an example testfile that shows all three of these in action.While we do use PyTest as our test runner and for some implementation tests, please check with a maintainer before using a PyTest-specific 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.
🆘 Next Steps & Getting Help
If you'd like to work on this issue, comment saying "I'd like to work on this"
(there is no real need to wait for a response, just go ahead, we'll assign you and put a[claimed]
label on the issue).