There are a few I’m aware of:

  1. Rust-style use (multiple imports per statement, renaming items using as)
  2. Java-style import (single import per statement, no renaming (afaik))
  3. Zig-style let xlib = @import("xlib") (imports as assignments)
  4. C-style #include (no importing, just pastes the code of the named file)
  • sik0fewl@piefed.ca
    link
    fedilink
    English
    arrow-up
    18
    arrow-down
    1
    ·
    7 days ago

    I don’t know, but my least favourite has to be Python with its from syntax.

    e.g.,

    # fine
    import os.path
    
    # what??
    from os import path
    
    • Pyro@programming.dev
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      6 days ago

      I don’t mind the syntax as such but the whole module, file, relative hidden import rules drives me nuts.

    • bruh11@sh.itjust.works
      link
      fedilink
      arrow-up
      6
      ·
      7 days ago

      iirc there is also this patter of putting the following inside init.py:

      from .myfunction import myfunction