Skip to content

[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

Merged
merged 40 commits into from
Apr 27, 2020
Merged

[mypyc] Add some user documentation #8677

merged 40 commits into from
Apr 27, 2020

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Apr 15, 2020

This should cover most of the basics.

@JukkaL JukkaL requested a review from msullivan April 15, 2020 19:59
Copy link
Member

@JelleZijlstra JelleZijlstra left a 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
Copy link
Member

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?

Copy link
Collaborator Author

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.
Copy link
Member

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?

Copy link
Collaborator Author

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.


Value types have a few differences from heap types:

* Object identity is not predictable (this includes ``is`` checks).
Copy link
Member

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.

Copy link
Collaborator Author

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.

@JukkaL JukkaL merged commit 2c8d76e into master Apr 27, 2020
@gvanrossum gvanrossum deleted the mypyc-user-docs branch August 26, 2020 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants