Allow import (some,list,of,modules,with,parenthesis)

I think you’ll have a slightly better argument of readability if instead of:

import (os, sys, ...
        importlib)

you put each module name/path on a separate line:

import (
    os,
    sys,
    importlib,
)

so that it’s at least as diff-friendly as the status quo.

While I agree with the consistency argument, I can see why the devs may think it would generate unnecessary churns without offering any functional benefit over the status quo of writing a separate import statement for each module.

Maybe there can be additional functionalities to justify a new syntax, such as an as clause:

import (
    os,
    sys,
    importlib,
) as _private # a simple namespace object

_private.sys.exit(0)

or maybe if the async import statement from Async imports to reduce startup times ever reaches consensus in the future, it will be more apparent that repeatedly writing async import statements:

async import os
async import sys
async import importlib

is too much clutter compared to:

async import (
    os,
    sys,
    importlib,
)

Neither is too compelling still though.

1 Like