-
Notifications
You must be signed in to change notification settings - Fork 0
PoC: rip out the allocator API #33
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
PoC: rip out the allocator API #33
Conversation
Alternative to #31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!! A few suggestions to simplify the code even more. I've checked locally that all tests pass with them applied
Tools/clinic/clinic.py
Outdated
lines = [p.render_docstring() + "\n" for p in params if p.docstring] | ||
return "".join(lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lines = [p.render_docstring() + "\n" for p in params if p.docstring] | |
return "".join(lines) | |
return "".join(p.render_docstring() + "\n" for p in params if p.docstring) |
We could even just get rid of this method and inline the call: it's only called in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, absolutely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OTOH, the method name increases the readability slightly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can keep it as a separate method!
…APIs Replace the internal accumulator APIs by using lists of strings and join(). Yak-shaving for separating out formatting code into a separate file.
out.append(s.format(f.full_name, count_min, count_max)) | ||
out.append(' goto exit;\n') | ||
out.append("}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out.append(s.format(f.full_name, count_min, count_max)) | |
out.append(' goto exit;\n') | |
out.append("}") | |
out.extend([ | |
s.format(f.full_name, count_min, count_max), | |
' goto exit;\n', | |
'}', | |
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I prefer the existing variant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I don't feel strongly! The existing variant is fine
8eae4f0
to
cb85794
Compare
(I'll incorporate your latest suggestions over there) |
No description provided.