question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[New Concept Exercise] : classes

See original GitHub issue

This issue describes how to implement the classes 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 classes in Python.

Learning objectives

  • understand what a class represents in Python
  • how to declare (create) a class
  • understanding that instantiating a class creates an object
  • understand the difference between class properties vs instance attributes
  • understanding that bound functions of a class are methods
  • the uses of self to denote method
  • creating/using __init__() to customize object creation
  • using pass as a placeholder for class methods

Out of scope

  • class-customiation, including @classmethod & @staticmethod
  • @property decorator, getters, and setters
  • class members & non-public methods
  • class-inheritance, multiple-inheritance, __super()__, class mixins
  • class-composition
  • dataclasses
  • performance considerations

Concepts

  • attributes
  • classes
  • methods
  • objects
  • OOP
  • properties

Prerequisites

These are the concepts/concept exercises the student needs to complete/understand before solving this concept exercise.

  • basics
  • bools
  • comparisons
  • dicts
  • iteration
  • lists
  • numbers
  • sequences
  • sets
  • strings
  • tuples

Resources to refer to

  • Hints

    For more information on writing hints see hints

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

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

    For more information, see Exercise introduction.md

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

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 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 : 3550ec07-f6c6-48bd-b2b4-086e75faf9e7
  • concepts should be filled in from the Concepts section in this issue
  • prerequisites should be filled in from the Prerequisites section in this issue

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

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
PaulT89commented, Jan 24, 2022

Okay, it’s in the exercism/python/exercises/concept as ‘ellens-alien-game’. The introduction and design files are empty (except for a TO DO mark in them).

Other things:

  • While the test file works, and is verbose in its error messages, I’m not entirely sure I’ve laid it out in a way that would make perfect sense for a concept exercise. I’ll need feedback on whether or not I need to rework it.
  • I’m not sure if the incrementing of a class variable (total_aliens_created) is too advanced for a beginner to wrap their head around, but I thought it was still technically within scope, and would at least show them something they (probably) couldn’t do without classes.
  • I already listed you as an author in the config file - you’ve already given me so much help 😄
1reaction
PaulT89commented, Jan 22, 2022

@BethanyG Okay, I’ve completed an exemplar file, a solution file, and a test file. It’s getting late, so I think I’ll start on the documentation tomorrow. I suspect that I may need help with everything else though (metadata files and whatnot).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fresh, New Fitness Class Ideas that Leverage the Latest Trends
Fresh, New Fitness Class Ideas that Leverage the Latest Trends · Take Your Fitness Classes Outdoors · Create Opportunities for Social Connection.
Read more >
Top Fitness Trends Of 2022 - Best Workout Tips and Health ...
The Biggest Fitness Trends Of 2022: From Mushrooms To Reverse Running · More Mushrooms · Reverse Running · Gym Hygiene · Inclusive Fitness...
Read more >
Wondercise to reveal a new-age concept fitness facility at CES ...
The facility will feature three main types of group fitness courses: aerobics, yoga, and spinning. The signature and patented Live Motion ...
Read more >
Concept Fitness
The CLASS. Small group fitness classes that feel more like personal training. ... Concept Fitness is a premier rowing, strength and conditioning facility....
Read more >
12 fitness trends for 2022 - Glofox
While HIIT and yoga will always be popular group workouts, we're seeing classes like trapeze, roller skating, and trampoline grow in popularity.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found