Skip to content

Conversation

@pierreglaser
Copy link
Contributor

@pierreglaser pierreglaser commented Feb 6, 2019

bpo-35911: Add a cell constructor

This PR adds:

  • a cell.__new__ method, with an optional contents arguments.
  • the cell type in the Lib/types.py module, under the name CellType

Additional docs and tests are also provided.

The rationale behind this PR is explained in detail in the corresponding bpo issue.

https://bugs.python.org/issue35911

@pierreglaser pierreglaser changed the title Bpo 35911 add cell constructor bpo-35911 add cell constructor Feb 6, 2019
@pitrou pitrou changed the title bpo-35911 add cell constructor bpo-35911: add cell constructor Feb 6, 2019
@pitrou pitrou added the type-feature A feature request or enhancement label Feb 6, 2019
Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, looks like a no-brainer to me.
Will wait a bit for other core devs. Feel free to ping in a few days if no other feedback comes.

@pitrou
Copy link
Member

pitrou commented Feb 6, 2019

@1st1 @benjaminp @ncoghlan

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. May be worth updating https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy to cross-link the new type when it mentions cell_contents.

@pitrou pitrou merged commit df8d2cd into python:master Feb 7, 2019
@pitrou
Copy link
Member

pitrou commented Feb 7, 2019

Thanks @pierreglaser !

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

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants