PyO3 / PyO3/pyo3

Bikeshedding names: `Py` and `PyObject`

Open
#873 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1.0-must help-wanted needs-design refactoring
Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

Having written this fairly innocent comment in #863:

I've been wondering what happens if we renamed PyObject to just Object - I don't think the Py is particularly interesting and typing Py<Object> is heck of a lot less annoying than Py<PyObject>. This would be a good moment to do such a rename if we're breaking everything anyway.

It seems like a few people had ideas and opinions about what we could do on this point, mostly focussing on renaming Py.

Rather than let that discussion sidetrack from discussion in #863, I thought it best to open this issue.

The current names Py, and PyObject are fine, though I am always open to improving things if there's a strong community opinion for one thing over another. To be clear though, a rename of such core pieces like this would cause a lot of churn to all pyo3 users - so if we do this, let's wait until we're totally confident on the names we like, and then do the rename once only.

Some proposals of alternative names for Py:

  • PyRc

Some proposals of alternative names for PyObject:

An interesting option is what rlua does; types are not Lua prefixed in the API, but they are in rlua::prelude to avoid confusion.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading issue #863 and the discussion here to understand the proposed naming changes and their compatibility impact. Review the current public API names Py and PyObject; this issue is complete only when the community reaches a firm decision on the names and scope of any rename.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.