Comments (3)
To use type annotations you have to do what it says at the top of the file, specifically:
from __future__ import annotations
from apsw.
Ah yeah indeed, sorry.
I found the type definition in __init__
which is why I thought it might be a bug / regression.
But it is __init__.pyi
, not __init__.py
from apsw.
Apologies for getting mixed up in this. I've updated the comments to make it clear that future import annotations is mandatory. If you make only that change then everything will be fine and all tools that deal with typing including mypy and language servers, vscode etc will do the right thing.
The import postpones evaluation of annotations (PEP 563). As you noticed SQLiteValues and several other types aren't real, and are there to help type checkers. The core of APSW is implemented in C which is why they aren't real. They are intentionally provided in the corresponding .pyi
file - known as type stubs - PEP 561.
All this typing stuff is fairly messy behind the scenes. But you should experience a convenient and smooth experience using them, and if not then that is a bug.
from apsw.
Related Issues (20)
- URIFilename doesn't detect underlying database has been closed
- Allow multiple auth/profile etc
- Make statement cache recycle bin be part of per Connection StatementCache and not separate, also check hash algorithm
- VFS Null filename opens HOT 10
- Cursor.executemany should be annotated as accepting Iterable[Bindings] instead of Sequence[Bindings] HOT 1
- Implement Unicode TR-29 and TR-14 HOT 1
- error: static declaration of ‘PyLong_AsInt’ in Python 3.13+ HOT 3
- Switch to cosign for signing
- Incorrect values in `colUsed` HOT 2
- Update to Unicode 16.0 when released September 2024 HOT 1
- connection.set_row_trace - excepts; Connection.setrowtrace works HOT 4
- `connection.setrowtrace` stops working when adapters are registered HOT 5
- Datetimes into sqlite via APSW HOT 1
- Revise logging levels
- query execution row and time limits HOT 1
- Support subtypes in functions
- Don't cache pragmas
- con.pragma can't accept blobs HOT 1
- Update Connection.pragma with schema parameter
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 apsw.