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
Clinic: use raw types in types= set #68189
Comments
New proposed semantics for the types= parameter to converters: where possible, pass in actual types. The resulting syntax: c: int(types={str}) # maps to 'U' Since "buffer", "robuffer", and "rwbuffer" are fake pseudotypes, I created empty classes with those names. Serhiy: with this change in place, the types= parameter uses almost the same number of characters as it used to when it was a string. (The new syntax requires commas between elements, so for two or more types it's slightly longer.) Yet this makes the types= parameter far more accurate in illustrating what it's supposed to represent. Does this make you happy? :) |
Should types= be renamed accept= ? It's a set of the types of the Python objects that this parameter should accept. |
I should mention that evalify_node() is pretty hacked up here, and is not ready to be checked in. (I'm proposing separately that we simply add something like this directly into the standard library, see issue bpo-24002.) |
accept= (or accept_types=) LGTM. |
Thanks to bpo-24002 I now know how to write evalify_node properly. This revision of the patch is much better, and maybe ready for checkin. |
Looks as this is a patch for different issue. |
Whoops. I'll fix that. |
Here's the right patch. |
Attached is a patch implementing all my proposed changes here:
|
Usually converters are named by the C type of the result. May be rename the "str" converter to "pchar"? |
New changeset 41fb7fd04b5d by Larry Hastings in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: