tornadoweb / tornadoweb/tornado

Feature request: support buffer protocol objects in `tornado.web.RequestHandler.write`

Open
#2,369 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

web
Dominant language
Python
Stars
22.2k
Forks
5.6k
Avg merge
3h 42m
Merged PRs (30d)
16

Description

Current write method only accepts bytes, str and dict. If it supports in addition objects conforming to buffer protocol, conversion to bytes can be avoided, and so are memory allocation and data copy.

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 at tornado.web.RequestHandler.write and review how its current accepted types are handled. Done means buffer-protocol objects are accepted without requiring callers to convert them to bytes, while existing bytes, str, and dict behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.