-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Path decorators: allow empty docstrings to support embedded Python #2979
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2979 +/- ##
==========================================
- Coverage 99.63% 99.62% -0.01%
==========================================
Files 117 117
Lines 17598 17602 +4
Branches 3171 3174 +3
==========================================
+ Hits 17533 17536 +3
- Misses 46 47 +1
Partials 19 19
|
IMO we shouldn't set the docstring if there isn't one, rather than acting as though the docstring is blank. |
That would make sense yes. This might be tricky to test for though - Trio can't work in |
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.
Sorry, I should have marked my previous comment properly. Here it is just as reference:
IMO we shouldn't set the docstring if there isn't one, rather than acting as though the docstring is blank.
Could add tests which monkeypatch |
I added a test case cause it can be annoying to make them. cc @jakkdl does it look good? (the only iffy bit is passing a sync function to a function that assumes it is async -- but it's not like we run it and we can update that if we ever require passed in functions to satisfy |
@ameily I'm super flakey on these (so you can ignore this if you want) but you don't have a changelog attached! Might be nice to have that. |
looks great! (other than needing a |
Co-authored-by: EXPLOSION <git@helvetica.moe>
Hey @ameily, it looks like that was the first time we merged one of your PRs! Thanks so much! 🎉 🎂 If you want to keep contributing, we'd love to have you. So, I just sent you an invitation to join the python-trio organization on Github! If you accept, then here's what will happen:
If you want to read more, here's the relevant section in our contributing guide. Alternatively, you're free to decline or ignore the invitation. You'll still be able to contribute as much or as little as you like, and I won't hassle you about joining again. But if you ever change your mind, just let us know and we'll send another invitation. We'd love to have you, but more importantly we want you to do whatever's best for you. If you have any questions, well... I am just a humble Python script, so I probably can't help. But please do post a comment here, or in our chat, or on our forum, whatever's easiest, and someone will help you out! |
I am developing an application that runs on the Windows embedded Python package. It appears that the embedded Python standard library does not include docstrings which means an unhandled exception is raised when importing trio because of a couple
assert X.__doc__ is not None
statements. This PR makes it so__doc__
is allowed to beNone
.To test, I am using Python Windows Embedded 64-bit 3.11.8 package. I wrote a small script to show that
__doc__ is None
on every Path function:When I run this through embedded Python I see every function in
Path
has no docstring.