question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi!

First, thanks for all the great work on EdgeDB. The Python driver looks fab, and I especially like the built-in async support.


Problem description From what I’ve seen, edgedb-python public-facing APIs do not provide type annotations. I discovered this by using edgedb.async_connect() and wondering why my editor wouldn’t autocomplete the con object.

Proposed solution Since edgedb-python is targeting Python 3.6+, I believe it should fully embrace type hints. Adding these would add a lot in terms of IDE support and developer productivity.

Implementation ideas If not, I’d be very glad to give a helping hand adding these to the library. The PR might be quite big — should we consider splitting the work by tackling public-facing APIs only first? Let me know!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
elpranscommented, Jun 19, 2019

You aren’t interrupting it, are you? If may appear to hang after that message, but it’s not, the parsers are getting built and that takes a while.

2reactions
1st1commented, Jun 19, 2019

After looking at the docs again, the connection and transaction objects seem to be the main APIs indeed, so only annotating these would already be a great step forward.

Feel free to go ahead and submit a PR! We can then release an updated version shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typing — Support for type hints — Python 3.11.1 documentation
Source code: Lib/typing.py This module provides runtime support for type hints. The most fundamental support consists of the types Any, Union, Callable, ...
Read more >
Understanding type annotation in Python - LogRocket Blog
Python lists are annotated based on the types of the elements they have or expect to have. Starting with Python ≥3.9, to annotate...
Read more >
Type Annotation in TypeScript - TutorialsTeacher
TypeScript - Type Annotations. TypeScript is a typed language, where we can specify the type of the variables, function parameters and object properties....
Read more >
Type Annotations and Pluggable Type Systems
This means that annotations can be used anywhere you use a type. A few examples of where types are used are class instance...
Read more >
Using Python's Type Annotations - DEV Community ‍ ‍
Type Annotating is a new feature added in PEP 484 that allows adding type hints to variables. They are used to inform someone...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found