exercism / python

Exercism exercises in Python.
https://exercism.org/tracks/python
MIT License
1.94k stars 1.29k forks source link

[V3] Implement new Concept Exercise: comparisons #2288

Closed DavidGerva closed 3 years ago

DavidGerva commented 4 years ago

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

This concept exercise should teach how basic (non-customized) comparisons work in python and how to use them effectively.

Learning objectives

Out of scope

Concepts

Prerequisites

Resources to refer to

Hints

Concept Description

(a variant of this can be used for the v3/languages/python/concepts/<concept>/about.md doc and this exercises introduction.md doc.)

The concept description needs to be filled in here.

Representer

No changes required.

Analyzer

No changes required.

Implementing

Tests should be written using unittest.TestCase and the test file named comparisons_test.py.

Code in the .meta/example.py file should only use syntax & concepts introduced in this exercise or one of its prerequisites. Please do not use comprehensions, generator expressions, or other syntax not previously covered. Please also follow PEP8 guidelines.

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

DavidGerva commented 4 years ago

@BethanyG, please I would like to have a review to this issue. Not sure about (a lot of things and):

BethanyG commented 4 years ago

@DavidGerva - apologies for taking so long to give you feedback. Thank you so much for filing this issue and for raising questions about it.

I really struggled to zero in on what felt like the "right" collection of functionality here. I am still not sure I got it correct, and we may need to discuss this further with others. As for language -- I changed the title to comparisons on the logic that Python has many methods and implementations of comparison, and we are talking specifically about those and not the general concept.

I think that numbers and floating-point-numbers - or some variants thereof might include comparisons, but that it's fine to have overlap. I think making numeric comparison its own exercise is probably overkill. Still not sure that None and NotImplemented belong -- we may want to remove those.

I added more comparisons for various types, since the Python docs point out that many built-in types have their own comparison rules that might not be intuitive at first glance. I also added an item about comparisons yielding boolean values since we pulled comparison operators out of the booleans exercise. I essentially followed this comparisons entry in the Python language reference, but with a lot less detail.

I moved the __eq__() method and any customization to "out of scope" -- I think language and behavior customizations should be their own exercise -- or at the very least, we should have a "rich comparisons" exercise where we might cover customization.

Having said all that - I am very open to pushback. I could see equal arguments for including comparisons with each built-in type or for pulling it out into an exercise as we have here.

@cmccandless @ErikSchierboom - your thoughts? are we on the right track??

ErikSchierboom commented 4 years ago

I think that numbers and floating-point-numbers - or some variants thereof might include comparisons, but that it's fine to have overlap. I think making numeric comparison its own exercise is probably overkill. Still not sure that None and NotImplemented belong -- we may want to remove those.

Some overlap is fine here I feel.

I moved the eq() method and any customization to "out of scope" -- I think language and behavior customizations should be their own exercise -- or at the very least, we should have a "rich comparisons" exercise where we might cover customization.

Without having any Python knowledge, it sounds like a sensible thing to do.

cmccandless commented 4 years ago

Sounds good to me!

BethanyG commented 4 years ago

Oh for &^!#% sake. None of the edits I made to this issue were actually saved. I am so annoyed right now. Apologies everyone for the spam with no purpose. Will re-edit.

BethanyG commented 4 years ago

Re-edited with details described above. Chime in if this looks strange..

DavidGerva commented 4 years ago

Really nice. I'm glad it was useful to raise the doubts.

Limm-jk commented 3 years ago

Hello! Is this issue in progress? If not, can I take up the issue?

BethanyG commented 3 years ago

Hi @Limm-jk ! We'd be delighted if you wanted to take up this issue 🌟 Thank you. 🌈

I don't yet have a concept description (apologies for that), but can work on one today/this weekend & post it here when I'm done. LMK here or in Slack if you have any questions or problems.

Looking at the list of items to cover, it does look long - so we can have a discussion if it looks like the exercise is going to get too complex. Since these are comparisons (and return booleans), it might be fun to do an extension on the story for bools that we have here: Ghost Gobble Arcade Game -- but you can always come up with your own story 😄 , or you can also use one from this list: exercise stories.

Thanks again for volunteering!

Limm-jk commented 3 years ago

Thank you! I'll get started as soon as you tell me. Where can I get information about exercism's slacks? I would appreciate it if you could tell me how to work in Slack.

BethanyG commented 3 years ago

Hi @Limm-jk! For Slack, I just need an email and I can send you an invite directly. Is the one on your GitHub profile OK to use? I will send an invite there, and we can change it later if you need to.

EDIT: Since invites need admin approval, and the admins are in GMT and CET, there will be a delay for Slack.

BethanyG commented 3 years ago

@Limm-jk - also - it is ok to start writing now if you are eager to get started. I may not have the concept description written until tomorrow my time (I'm in Pacific time, so I am 17 hours behind you. 😆 ).

Limm-jk commented 3 years ago

Hi @Limm-jk! For Slack, I just need an email and I can send you an invite directly. Is the one on your GitHub profile OK to use? I will send an invite there, and we can change it later if you need to.

EDIT: Since invites need admin approval, and the admins are in GMT and CET, there will be a delay for Slack.

Good! I added e-mail in my profile. Thanx XD

github-actions[bot] commented 3 years ago

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

BethanyG commented 3 years ago

Will be closing this issue, since PR #2420 completes this. Any edits/additions/re-writes will be noted under a different issue.