Skip to content

Should we get rid of trio.ssl and trio.subprocess, and tell people to just import ssl/subprocess instead? #852

Closed

Description

@njsmith

In the Beginning [1] there was trio.socket. Using a nested namespace seems like the only reasonable way to handle this, because we want to expose 99% of the functionality of the socket module, the socket module API is huge, and the changes we needed to make are complex and all over the place.

Then we copied this style for trio.ssl, and then trio.subprocess.

But for these two modules, it's not as compelling. trio.ssl is just SSLStream and SSLListener, plus a ton of complicated re-exports. trio.subprocess is just Process, plus a ton of complicated re-exports.

Given this, maybe it would be better to put SSLStream, SSLListener, and Process into the top-level trio namespace, and drop the trio.ssl and trio.subprocess modules entirely. Instead we'd just tell people they can import ssl or import subprocess.

CC: @oremanj since this is partly triggered by #833

[1] Actually, I stole the idea from curio.socket.

Activity

  1. pquentin commented on Jan 11, 2019

    @pquentin
    Member

    composition > inheritance

    👍

  2. Zac-HD commented on Jan 11, 2019

    @Zac-HD
    Member

    Also in favour of simplicity here - and working with small code bases is much more fun.

  3. oremanj commented on Jan 11, 2019

    @oremanj
    Member

    I'm in favor of this change.

  4. oremanj commented on Jan 16, 2019

    @oremanj
    Member

    That looks like four in favor, none opposed - does this need further thought or is it just blocking on someone to do the PR? I can do the PR if it's the latter.

  5. njsmith commented on Jan 16, 2019

    @njsmith
    MemberAuthor

    @oremanj go for it

  6. added a commit that references this issue on Jan 16, 2019
    f6a2527
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions