python / python/mypy

support for easy limiting of literals to entrypoint names and/or the entrypoint lookup value

Open
#17,719 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Feature

for utilities where names/types match to entry-pints, it would be really nice to be able to do that without making a plugin each time

example

class MyPlugin:
   pass

PluginName = Typevar("PluginName", EntrypointLiteral["myapp.plugin"]


class MyApp:


   def __getattr__(self, name: PluginName) -> InstanceOfEntrypoint[PluginName]:
        ...

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 with the proposed EntrypointLiteral and InstanceOfEntrypoint forms and the getattr example. Clarify how entrypoint names and lookup values should be limited without a plugin, then define the expected typing behavior for the shown MyPlugin and MyApp example. Done means the feature’s scope and behavior are specified well enough to guide implementation and tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.