[issue19438] Where is NoneType in Python 3?

2020-10-21 Thread Andrés Delfino
Andrés Delfino added the comment: As per https://github.com/python/cpython/pull/22336 I believe this issue can be closed now. My PR is not relevant to the problem stated by OP, so I'm "unlinking" it. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue19438] Where is NoneType in Python 3?

2020-09-09 Thread Andrés Delfino
Andrés Delfino added the comment: ammar2 found this mail mentioning the changes in that commit https://mail.python.org/pipermail/python-dev/2007-November/075386.html "I've removed the 'new' module from py3k and also removed a lot of types from the 'types' module in py3k. It only contains

[issue19438] Where is NoneType in Python 3?

2020-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the link. It looks like NoneType got inadvertently caught up in the sweep of names that had direct synonyms. -- ___ Python tracker

[issue19438] Where is NoneType in Python 3?

2020-09-08 Thread Andrés Delfino
Andrés Delfino added the comment: types.NoneType was removed here: https://github.com/python/cpython/commit/c9543e42330e5f339d6419eba6a8c5a61a39aeca#diff-0f021aec4e35b86a3160d44069dec997 The thing of adding NoneType to types that is somewhat unpleasing to me is that it's named exactly as the

[issue19438] Where is NoneType in Python 3?

2020-09-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would support adding NoneType back to the types module. Am not sure why it was ever removed. It has a much reason to exists as types.FunctionType which is a clear, well-named short-cut for "type(lambda :None)". -- nosy: +rhettinger

[issue19438] Where is NoneType in Python 3?

2020-09-08 Thread Andrés Delfino
Change by Andrés Delfino : -- keywords: +patch nosy: +adelfino nosy_count: 3.0 -> 4.0 pull_requests: +21235 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22161 ___ Python tracker

[issue19438] Where is NoneType in Python 3?

2013-11-17 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- nosy: -christian.heimes priority: normal - low versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19438 ___

[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread Christian Heimes
Christian Heimes added the comment: How about: type(v) in (bytes, type(None)) or: isinstance(v, (bytes, type(None)) or: v is None or type(v) is bytes or: v is None or isinstance(v, bytes) -- nosy: +christian.heimes ___ Python

[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread mpb
New submission from mpb: types.NoneType seems to have disappeared in Python 3. This is probably intentional, but I cannot figure out how to test if a variable is of type NoneType in Python 3. Specifically, I want to write: assert type (v) in ( bytes, types.NoneType ) Yes, I could write:

[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread mpb
mpb added the comment: Of your 4 suggestions, I mentioned #3 and #4 in my post. They are less readable, IMO. 1 and 2 are nicer, but both have an extra set of nested parenthesis. While I appreciate the suggestions, I submitted this as a documentation bug, because I think I should be able to

[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread R. David Murray
R. David Murray added the comment: See http://www.python.org/dev/peps/pep-0294/ for some background on this. The unexpected thing is actually that the types module still exists at all in Python3 :) That said, its documentation could, indeed, use some improvement to address this kind of

[issue19438] Where is NoneType in Python 3?

2013-10-29 Thread mpb
mpb added the comment: Regarding http://www.python.org/dev/peps/pep-0294/ ... Complete removal of the types module makes more sense to me than letting types continue, but removing NoneType from it! If type(None) is the one_true_way, then the docs should say that, possibly in multiple