[Making the Grade] Union return type in Task 6
See original GitHub issueIMO the union return type is not needed in a concept exercise. Besides, I don’t see the value it provides at all in the current setting because <student name>
is the only unique part that is matched.
My suggestion is to have a str
return type, i.e.:
:return: str - name of the first student with a perfect score or 'No perfect score.' if not found.
Happy to submit a PR.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
C# how to combine 2 Task<IEnumerable<T>> via Union and ...
If the IEnumerables weren't wrapped in Tasks, of course I would just do: var ResultC = ResultA. Union(ResultB); How can I accomplish this...
Read more >Handbook - Unions and Intersection Types - TypeScript
A union type describes a value that can be one of several types. We use the vertical bar ( | ) to separate...
Read more >Union 6th/7th Grade Center Home - Union Public Schools
We welcome all sixth and seventh grade students and their parents! The 6th/7th Grade Center ... Return in person to the Union 6th/7th...
Read more >6. Compounding Rules A compound word is a union of two or ...
When com- pound words must be divided at the end of a line, such division should be made leaving prefixes and combining forms...
Read more >Common Abbreviations & Acronyms Used In Workers ...
Estimated Return To Work/Early Return To Work. 5020. Employer's First Report of Work Injury (Form #). F & A ... Workers' Compensation Insurance...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I expect to pick this right after #2668 is merged (or dismissed).
No @pranasziaukas – I don’t think you are overthinking it. (Perhaps I was when making the exercise & deciding to include nested data structures…but that’s a wholly different story…) 😄
I think the real problem is that there aren’t strong standards or practices around this. Python is dynamically/duck typed, and functions return objects, typing TBD. There are conventions (and hints), and they vary by programmer, team and project. It’s an architecture and design discussion. That doesn’t mean I am arguing for arbitrary multi-return types – just that the concern is most often in a context of how an overall program or application is built and used.
So I don’t really think it is a big deal to have type mis-match here where the code is isolated and focused on a specific concept like
loops
. And yes, that probably makes me a naughty Pythonista. 😄TL;DR I can certainly live with changing it to
and might even propose that it be amended somewhat to:
:return: first `[<student name>, 100]` or `[]` if no student score of 100 is found.
Let’s just make sure that the instructions, examples, docstrings, et. al. are checked to make sure that the change is clear to students.
And thank you both for discussing this. 💜