memesearch
Python Annotations Ignored Lmao

Python Annotations Ignored Lmao

Download Find similar pictures
Text on the meme
Wait the Annotations Are Just Ignored Lmao Demonstrating Unsoundness in the Python Type System R. Shastri Carnegie Mellon University, USA shastri@cmu.edu A. Kumar Indian Institute of Science, IND ta.kumar@iisc.ac.in 1. Introduction In recent years, type checking has become increasingly popular, both as a design aid and to improve confidence in software correctness. This has even been true among communities that have traditionally favored untyped languages. For example, Microsoft's TypeScript language [33] maintains the runtime semantics of JavaScript while allowing users to provide type annotations. Recent versions of Python, another untyped language, added support for type annotations into the language itself [29]. However, static typing has not been without its own issues. Scala, a major statically typed language, was demonstrated to be unsound in 2008 [3], and in 2016, Java, a minor language that has received little academic attention, was as well [1]. These results centered on a disconnect between existing research, which had generally analyzed soundness of individual features, and production implementations, which used these features in incompatible ways. Of particular note The ability to create and instantiate new classes at run time, extend arbitrary objects with new behavior, and access objects that would typically be private using the gc module [18]. The authors initially concluded that, to support these features, the developers of the Python language had made theoretical advances in refinement types, dependent types, and Hoare logic. Basic testing also indicated that these features were paired with a type inference algorithm which allowed the implementation to work without explicit annotations in most cases. However, we discovered a number of soundness issues allowing conversion between arbitrary types, which we attribute to the implementation not actually checking whether values are used in a conforming manner. from typing import TypeVar A, B = TypeVar('A'), TypeVar('B') def f(x: A) -> B: return x
What it means

This is a mock academic paper screenshot titled “Wait the Annotations Are Just Ignored Lmao,” presented as a paper about unsoundness in Python’s type system. The joke is that the function claims to convert a value from one arbitrary type to another, while Python’s type annotations are not enforced at runtime. It is shared as a reaction to Python’s permissive typing and the gap between static annotations and actual behavior. EN: This is a mock academic paper screenshot titled “Wait the Annotations Are Just Ignored Lmao,” presented as a paper about unsoundness in Python’s type system. The joke is that the function claims to convert a value from one arbitrary type to another, while Python’s type annotations are not enforced at runtime. It is shared as a reaction to Python’s permissive typing and the gap between static annotations and actual behavior.

Objects
Tags
Source
Type
image
Size
800×578 · 103.6 KiB
Mood
sarcastic, absurd
Language
en
Added