-
-
Notifications
You must be signed in to change notification settings - Fork 3k
[mypyc] Add some user documentation #8677
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
Conversation
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.
This is very helpful! I read through and added a few comments.
|
||
Frames of compiled functions can't be inspected using ``inspect``. | ||
|
||
Pofiling hooks and tracing |
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.
Typo ("Pofiling")
Also, is there a way you do profiling of the native code that could be discussed here?
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.
I don't have a good story for profiling native code, but it should be possible using gprof
or other C profiler (maybe perf
?). We can update this section once we've figured this out. In the past I've used some ad hoc profiling hacks that aren't suitable for end users.
|
||
You can't set breakpoints in compiled functions or step through | ||
compiled functions using ``pdb``. Often you can debug your code in | ||
interpreted mode instead. |
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.
Presumably gdb should work too?
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.
I haven't tried it, so I left it out. If somebody manages to use gdb, we can update this.
mypyc/doc/using_type_annotations.rst
Outdated
|
||
Value types have a few differences from heap types: | ||
|
||
* Object identity is not predictable (this includes ``is`` checks). |
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.
This sounds like a big difference, because is None
is a very common idiom (and to a lesser extent, so are is True
and is False
). Would be good to say explicitly whether this works.
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.
Clarified that this is only an issue when comparing two integers or two tuples.
This should cover most of the basics.