[New-bugs-announce] [issue33983] unify types for lib2to3.pytree.Base.children

John Reese report at bugs.python.org
Wed Jun 27 16:38:19 EDT 2018


New submission from John Reese <jreese at leetcode.net>:

When type checking applications using lib2to3, the difference in types for lib2to3.pytree.Base.children versus Node.children makes it difficult to accept both leaves and nodes and programatically work with child nodes/leaves.  Base/Leaf both have `children` defined as an empty Tuple, while Node defines it as an empty list.  It would be more useful for Base/Leaf to also use an empty list, so that the type is the same, regardless of which type of object you are given.

----------
components: Library (Lib)
messages: 320616
nosy: jreese, lukasz.langa
priority: normal
severity: normal
status: open
title: unify types for lib2to3.pytree.Base.children
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33983>
_______________________________________


More information about the New-bugs-announce mailing list