-2
\$\begingroup\$

PEP 483 and PEP 484 finally introduced semantics for function annotations, and adds a new typing module to the standard library that provides important types, especially generics.

Any Python program that uses annotations now must use them as this PEP specifies, unless they use the @typing.no_type_check decorator. In other words, PEP 3107 is overridden. Note that PEP 3107 did anticipate that something like PEP 484 would happen.

I have observed that code written using the new typing module always follows a distinct dialect, both syntactically and stylistically. This is quite similar to the way Python2 and Python3 are dialects of Python, and sometimes require different advice in a review. Likewise, some people might prefer to avoid one dialect or another, but this new dialect is blessed by the BDFL.

Jamal removed the tag from my question since it did not exist here and does not exist on Stack Overflow either, but I think it deserves to exist. (Edit: and I do not think is a good fit).

Obviously, there is not a lot of experience with this module because it's only standardized in Python 3.5, which is still not released. However, with a third-party backport of the typing module, it works for Python 3.2, and there is even experimental support for Python 2.7 (either using # type: comments or using a codec to strip the annotations).

The mypy project was the motivator for the PEP and is the current focus for activity that uses the annotations for type-checking.

Synonyms I considered for the tag: , but since this is still rare retagging every question should be viable for now.

Any question tagged must be tagged and should be tagged either or .

\$\endgroup\$
  • 4
    \$\begingroup\$ What about type-safety? \$\endgroup\$ – 200_success Jul 16 '15 at 19:41
  • \$\begingroup\$ @200_success that looks like a meta tag to me, whereas python-typing conveys specific information that will have a major influence on the advice. \$\endgroup\$ – o11c Jul 16 '15 at 20:10
5
\$\begingroup\$

I'm not Python expert, but based on the way we handle tags on Code Review, this tag seems inappropriate.

200_success has recommended , and I think I agree with this recommendation. Your question doesn't make a case against this recommendation, but you left this comment:

that looks like a meta tag to me, whereas python-typing conveys specific information that will have a major influence on the advice

If you think it's a meta-tag, I highly recommend you make a post to argue that point and we can possibly get rid of the tag. But that's not what this thread is about.

The more important part of your point is that you argue that somehow conveys more specific information than a question tagged with and . I don't think that's the case. If that's the case, you need to demonstrate first that there are multiple types of type-safety in Python and second that conveys important information regarding the type of type-safety. And is it going to be used when type-safety is an important aspect of the question or just any time type-safety is used?

How about some corollaries to instances of other attempts at very language-specific tags?

The NS-specific tags for Objective-C/Swift were decided to be too specific.

Hash-map, hash-table, and dictionary are all considered the same thing, despite the fact that none of the languages I personally use on a regular basis have a hash-map or hash-table... they all have dictionaries... and you can't create a question with the dictionary tag.

To me, looks like an extraordinarily language specific tag in a language that is already littered with tons of language specific tags since they seem to require a tag for every version of the language...

\$\endgroup\$
  • \$\begingroup\$ Looking at questions tagged both type-safety and python (which already exists!), one of them has a comment "what do you mean by type-safety?". And, most other languages have tags such as generics (two languages) and template (one language), should those not exist? I agree with the ns and hashfoo merges fwiw. \$\endgroup\$ – o11c Jul 17 '15 at 1:23
  • \$\begingroup\$ [generics] isn't a language-specific concept. Generics is a concept in numerous languages, and there aren't language-specific generics tags (there's not a [swift-generics] tag). I'm not exactly certain what [template] is, but I see it tagged with multiple languages on CR (mostly C++, but I also see Python, Bash, JavaScript, and Xaml). \$\endgroup\$ – nhgrif Jul 17 '15 at 1:27
  • 1
    \$\begingroup\$ Hmm, I think I misunderstood your point, and after some research... I'm about to open a post recommending the synonimization of [template] into [generic]. \$\endgroup\$ – nhgrif Jul 17 '15 at 1:34
  • \$\begingroup\$ meta.codereview.stackexchange.com/q/5742/36366 \$\endgroup\$ – nhgrif Jul 17 '15 at 1:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .