ably-python icon indicating copy to clipboard operation
ably-python copied to clipboard

Import all types in __init__

Open jamesroseman opened this issue 1 year ago • 5 comments

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 avatar May 01 '24 15:05 jamesroseman

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.

jamesroseman avatar May 01 '24 15:05 jamesroseman

Related to #528

sacOO7 avatar May 01 '24 15:05 sacOO7

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 👍

sacOO7 avatar May 01 '24 15:05 sacOO7

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.

jamesroseman avatar May 01 '24 15:05 jamesroseman

@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.

sacOO7 avatar May 01 '24 16:05 sacOO7