ably / ably-python

Python client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
50 stars 24 forks source link

Import all types in __init__ #564

Open jamesroseman opened 6 months ago

jamesroseman commented 6 months ago

Working with ably Python SDK has been pretty painless so far, except that very few of the types that are defined in ably/types are available to me, the developer.

I propose expanding the imports in init to include most (all?) types defined in ably/types.

For example: it is not possible to create a variable to store a Realtime channel with a correct type definition.

┆Issue is synchronized with this Jira Task by Unito

jamesroseman commented 6 months ago

A concrete example:

`import ably

channel: ably.realtime.realtime_channel.RealtimeChannel`

This doesn't work.

`from ably.realtime.realtime_channel import RealtimeChannel

channel: RealtimeChannel`

This does.

sacOO7 commented 6 months ago

Related to #528

sacOO7 commented 6 months ago

Hi @jamesroseman, Thanks for reporting the issue! We do have pending issue to add strong type support. We will try to include fix for the same in future release 👍

jamesroseman commented 6 months ago

It seems like that issue has been open for 241 days. Any indication on a timeline? I'm doing some prototyping to evaluate an Ably solution and having type support would greatly impact my assessment of its suitability. It doesn't seem like a big lift. I'd offer to put up a PR myself but it seems the last PR set to address this issue was reverted a few weeks after it was merged.

sacOO7 commented 6 months ago

@jamesroseman feel free to open the PR. We will be happy to review and merge it as long as it doesn't impact/break for existing users.