[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Mercurial revs: fd0dce6d33e7, 15a35a8da24b, 4ecea1ea11bf, 4ecea1ea11bf.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks! Should go live later today.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I have only one optional comment on the second revision.

--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Michael Lee

Michael Lee added the comment:

Ok, here's revision 2 of my patch, after applying the changes from the last 
round of feedback.

--
Added file: http://bugs.python.org/file43939/document_newtype_rev2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

> Should I edit the patch to include a sentence or two describing this
> distinction, just remove the word "almost", or do something else?

I think the best way is to remove the "almost" and briefly explain that you 
cannot subclass types returned by NewType.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-28 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Added two small comments to the review.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-28 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-28 Thread Michael Lee

New submission from Michael Lee:

This is a patch to update the documentation on the typing module. It expands 
the section on type aliases and adds a section on [NewType][0].

Since support for NewType was [recently added][1] to mypy, it seemed like a 
prudent time to update the docs to describe this new feature.

The section on type aliases was mainly expanded because the distinction between 
type aliases and NewType could be potentially confusing, so adding extra 
clarification seemed like a good idea.

  [0]: https://www.python.org/dev/peps/pep-0484/#newtype-helper-function
  [1]: https://github.com/python/mypy/pull/1939

--
assignee: docs@python
components: Documentation
files: document_newtype.patch
keywords: patch
messages: 271572
nosy: docs@python, michael0x2a
priority: normal
severity: normal
status: open
title: Expand documentation about type aliases and NewType in the typing module
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43926/document_newtype.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com