Comments (9)
Whatever solution we pick should also be applied to decorated classes.
from typed_ast.
In python/mypy#3871 we seem to be of the opinion that adding class_lineno
and def_lineno
attributes are the best solution.
from typed_ast.
To be clear, I am adding this to ClassDef
, FunctionDef
, and AsyncFunctionDef
.
from typed_ast.
It appears this was fixed in python/cpython#9731. Perhaps we could backport that change after the update to being based on the 3.7 ast?
from typed_ast.
Taking into account size of the fix, can we backport just the fix now? Supporting 3.7 in typed_ast
may take time because of the ASYNC
problems, while this fix looks small and well localized.
from typed_ast.
Sure, I'd be happy to make a PR.
from typed_ast.
OK, let's do this then.
from typed_ast.
So... It looks like we took a different path. In Python 3.8's ast this is fixed, but it was not fixed in Python 3.7's ast. Typed_ast is now based on Python 3.7's ast.
Should we do it or not? I worry that just changing the lineno attribute of FunctionDef and ClassDef nodes will break tons of users' code since it changes where # type: ignore
comments would have to go. So maybe let sleeping dogs lie?
from typed_ast.
Let's leave typed_ast alone. With Python 3.8 we can support # type: ignore
backward compatibility, see python/mypy#3871 (comment) and further comments. For 3.7 and before we'll stick with the status quo.
from typed_ast.
Related Issues (20)
- test_ignores and test_convert_strs fail on ppc64 HOT 5
- Error Installing Pybinsim on Windows with Python 3.8 HOT 1
- Wheel support for aarch64 HOT 7
- typed_ast causes `IndentationError` when using "sphinx-autodoc-typehints" package HOT 2
- Error installing on Python 3.9 HOT 12
- Who has owner permissions on this repo? HOT 7
- Python 3.10 support? - undefined symbol: PyNode_ListTree HOT 3
- ast27 gives syntax error for valid code on s390x HOT 26
- Build failure installing on Python 3.10 HOT 5
- Fails to compile with Apple Silicon compiler HOT 11
- Building wheel in python ``3.10a7`` fail during installation HOT 3
- Older releases crash pip when it tries to build them HOT 2
- Compilation fails on Python 3.11 HOT 2
- Module load fails with Python 3.9.8 (undefined symbol _PyUnicode_DecodeUnicodeEscape) HOT 13
- typed-ast end of life? HOT 12
- Release 1.4.4 HOT 4
- typed_ast end of life (July 2023) HOT 1
- Aarch64 wheels not available on pypi HOT 3
- Install error on Python 3.10.1 windows HOT 4
- Module load fails with Python 3.9.13 (undefined symbol _PyUnicode_DecodeUnicodeEscape)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typed_ast.