-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Some suggestions #46
Comments
Can i contribute even I'm still novice but i want to learn more Thank you |
Sure! Any contributions are welcome! You can send pull requests in this project if you have any idea. |
I stumbled into your project when I was looking for how to correctly doc. my Python C extensions. Nice , that there is even a separate subject Doc String. Too sad, that it lacks how arguments are documented. Actually, I was looking for how to doc. possibly raised exceptions. (I just implemented a vector.normalize() and it may raise a |
Hi @scheff173 You mean this project can add some info about the detail of document string in C? For example (from PEP 7) #ifndef PyDoc_STR
#define PyDoc_VAR(name) static char name[]
#define PyDoc_STR(str) (str)
#define PyDoc_STRVAR(name, str) PyDoc_VAR(name) = PyDoc_STR(str)
#endif |
Hello,
My comment was about how to format the doc. text itself.
I believe there is a certain doc. format because `help()` accesses the doc. strings as well as external doc. tools (which, I must admit, I've never checked out - not yet).
The style guide in [PEP 7](https://www.python.org/dev/peps/pep-0007/#documentation-strings) looks as short as your doc. (just a statement - no offense)
I could swear we once found one where at least function arguments where mentioned as well.
This could look e.g. like this:
static PyMethodDef functions[] = {
{ "degToRad", °ToRad, METH_VARARGS,
"rf.degToRad(angle) -> float\n"
"converts a value in degree to the value in radians.\n\n"
"Arguments:\n"
"angle -- the angle in degree (float)\n"
},
{ "radToDeg", &radToDeg, METH_VARARGS,
"rf.radToDeg(angle) -> float\n"
"converts a value in radians to the value in degrees.\n\n"
"Arguments:\n"
"angle -- the angle in radians (float)\n"
},
nullptr
};
If I only could remember where I saw this. I will google again and let you know if I find something (may be, on weekend - week in office is near over on my side). ;-)
Thanks for your immediate reply & have a nice weekend, Dirk.
|
I googled a while to find something authoritative concerning how text of doc. strings should be formatted. This is what I found:
|
oh! I see. You recommend that this project can add some snippets to guide how to document the Python code, right? Issue #80 will handle this. Sorry, I am so too recently. I will update this issue soon. By the way, if you want to know how to write a doc in your C extension, you can refer to socket.c. Actually, I learned a lot of thing from CPython source code. 😃 |
suggestions from feedback
The text was updated successfully, but these errors were encountered: