Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Circular Buffer] draft approaches #3640

Merged
merged 3 commits into from
Mar 5, 2024

Conversation

colinleach
Copy link
Contributor

For this one I experimented with brevity to see how it looks.

What do you think - too short? Or about what this exercise deserves (in Python)?

@colinleach
Copy link
Contributor Author

Oops - I just found a blank section that I had intended to fill in later, then forgot about.

Added `memoryview`, `buffer protocol`, `array.array` and supporting links for various things.
@BethanyG
Copy link
Member

BethanyG commented Mar 5, 2024

Overall, I liked this, and for some exercises, I do think being briefer is a good thing.

I did go ahead and edit/add some things - I wanted to add more, but I think (given our timeframe) that this is going to have to do.

I really wanted to implement a memoryview approach, and one using either a ctype or struct -- but ended up not having the wherewithal to do so. I stuck with the simplest use of array.array -- which is essentially a mimic of using bytearray or list to underpin.

Maybe we can loop back to it, because it is really interesting to dig down underneath the sugar and poke at the C API. That being said, dig too far, and it becomes a shadow C track. Who says Python is only high-level? 😉

Copy link
Member

@BethanyG BethanyG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🌟 I am going to go ahead and merge this. Please do give it a read, and if there are any issues, I can PR something quickly to fix. But I think given the delays I caused, we should get this live to the site. 😄 Thank you so much for your hard work on this!

@BethanyG BethanyG merged commit 125a3f6 into exercism:main Mar 5, 2024
8 checks passed
@colinleach
Copy link
Contributor Author

Only issue I can see is a bit of grammar

Approach: Using built-in types
Python has an exceptionally flexible and widely-used list type. Most submitted solutions to Circular Buffer are based on this data type.

A less versatile variants include bytearray and array.array

"A less versatile variants include' is sign of edits gone a bit wrong. Intoduction.md, line 41

@BethanyG
Copy link
Member

BethanyG commented Mar 5, 2024

Will submit a fix here shortly, unless you want to?

@colinleach
Copy link
Contributor Author

I'm a bit distracted by other stuff this morning. You could probably do it quicker and more reliably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants