twisted / twisted/twisted

Creator and type information for Deferreds

Open
#5,722 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core enhancement new priority-normal
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

glyph's avatar @glyph reported
Trac ID trac#5722
Type enhancement
Created 2012-06-26 20:44:04Z

When you get a Deferred, you will typically see something like <Deferred at 0x10a541f38>.

But when you read the documentation for the thing that gave you that Deferred, it will tell you something about what the Deferred fires with.

I'd much rather see something like <Deferred originated by 'twisted.web.client.getPage', which will fire with 'int', at 0x10a541f38>.

In order to provide this information, callbacks could be annotated with a return type, and Deferred.__init__ would be modified to allow providing the name of the originator. inlineCallbacks would need special support.

This state could also be provided for introspection and debugging aids, similar to how Zope Interface provides us with tools to interrogate the type and claimed interface compatibility of an object.

Searchable metadata
trac-id__5722 5722
type__enhancement enhancement
reporter__glyph glyph
priority__normal normal
milestone__ 
branch__ 
branch_author__ 
status__new new
resolution__None None
component__core core
keywords__ 
time__1340743444000000 1340743444000000
changetime__1560836528674961 1560836528674961
version__None None
owner__None None

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 Deferred.init and inlineCallbacks, then trace how callbacks are annotated and how Deferred instances are created. Define how origin and fire-result type metadata should be represented, exposed for introspection, and preserved through inlineCallbacks; done means the behavior is implemented with debugging and introspection support.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.