Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make the imported module callable #14

Open
@Xion

Description

@Xion

While this marvelous library is obviously saving everyone a lot of time going back and forth between SO, clipboard, and their IDE, I feel its usage is still not as straightforward as it could be.

For example, in this snippet:

fromstackoverflowimportsplit_into_chunksprint(list(split_into_chunks.chunk("very good chunk func")))

you still need to know to call achunk function from the imported module. It could've beenchunks,split, or whatever else (depending on what the SO answer chose), forcing the programmer to (gasp!) look at the code he or she imports and perhaps even understand it.

I'd suggest that the importer should be clever enough to pick the correct function for the programmer, and then make the imported symbol itself callable:

fromstackoverflowimportsplit_into_chunksprint(list(split_into_chunks("very good chunk func")))

The heuristics of making the correct choice are left as exercise for the reader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp