Skip to content

How to specify constants of type NoneType? #2

Closed
@matthiaskramm

Description

@matthiaskramm

PEP 484 says "By default, None is an invalid value for any type". However, in the Python standard library there are class-level and module-level constants that are legitimately None.

Examples:

  formatter.py.AS_IS
  hmac.digest_size
  cgi.FieldStorage.FieldStorageClass
  copy.PyStringMap

Should we allow these to be declared using e.g. something like

  AS_IS = Undefined(NoneType)

?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions