Skip to content

PEP 669: Add an enum and namespace the interface. #2186

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 1 commit into from
Dec 10, 2021

Conversation

markshannon
Copy link
Member

From suggestion from @vstinner: put all the events into an enum and namespace the whole thing.

@vstinner
Copy link
Member

vstinner commented Dec 8, 2021

I suggested adding a new module because the sys module already contains 97 symbols. It seems like the sys module is the place where new functions are added when no better could be found. Maybe the sys module is a good place for these new event monitoring functions.

Maybe tomorrow, more high-level functions can be added in such hypothetical module, to have a more advanced and more high-level API. For example, the profile module has a command line interface and provides Profile and Stats classes. The timeit module also has a command line interface.

Moreover, if it's a separared module, it becomes easier to add more documentation about how it can be used, add recipes in the doc. See for example the tracemalloc module:
https://docs.python.org/dev/library/tracemalloc.html#examples

@markshannon
Copy link
Member Author

markshannon commented Dec 8, 2021

The original version of this PEP had a separate module, but @zooba suggested that it should go in the sys modules.
#2070 (comment)

I don't much care either way, so I'm happy to go along with the majority decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants