GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Isolate _multibytecodec · Issue #103583 · python/cpython

Isolate _multibytecodec #103583

New issue
Copy link
New issue
Copy link
Closed
#103869
Closed
Isolate _multibytecodec#103583
#103869
Copy link

Description

@erlend-aasland
erlend-aasland
opened on Apr 16, 2023
Issue body actions

Linked PRs

  • gh-103583: Add codecs and maps to _codecs_* module state #103540
  • gh-103583: Always pass multibyte codec structs as const #103588
  • gh-103583: Add ref. dependency between multibytecodec modules #103589
  • gh-103583: Isolate CJK modules, alternative 1 #103868
  • gh-103583: Isolate CJK codec modules #103869
  • gh-103583: Isolate CJK modules, alternative 3 #103870

Activity

  1. erlend-aasland
    changed the title [-]isolate _multibytecodec[/-] [+]Isolate _multibytecodec[/+] on Apr 16, 2023
  2. erlend-aasland commented on Apr 16, 2023

    @erlend-aasland
    erlend-aasland
    on Apr 16, 2023
    ContributorAuthor
    More actions

    In gh-103540 I've isolated _multibytecodec. However, more steps are needed to isolate the _codec_* (sub-ish) modules. I've identified some issues that IMO should be solved first, preferably in separate PRs:

    • There is no reference dependency between the _multibytecodec and the _codecs_* modules. This is a problem, because the MultibyteCodecObject type (of the _multibytecodec module) stores pointers to codec structs whose memory is owned by the _codecs_* modules. IMO, this needs to be done anyway, so we can start here.
    • There are two types of capsules used (one for maps, one for codecs), but both of them use the same name. IMO, this is both confusing and fragile. I suggest to use distinct names instead.
    • We need a way to store global pointers to codecs and maps; one possibility is to expand the MultibyteCodec struct and pass that to the various mb handlers. Another possibility is to store these in _codecs_* module state, store that state, for example in MultibyteCodecObject, and pass state to the mb handlers. Yet another possibility is to use the config member of MultibyteCodec for this, and change the semantics of that struct field.

    Also, some low-hanging fruit that IMO can be done right now:

    • We've got both MultibyteCodec_State and _multibytecodec_state. IMO, we should rename one of those; the current naming is too similar and confusing.
    • MultibyteCodec pointers should be passed as const
  3. erlend-aasland commented on Apr 16, 2023

    @erlend-aasland
    erlend-aasland
    on Apr 16, 2023
    ContributorAuthor
    More actions

    cc. @corona10

  4. erlend-aasland commented on Apr 16, 2023

    @erlend-aasland
    erlend-aasland
    on Apr 16, 2023
    ContributorAuthor
    More actions

    In gh-103540 I've isolated _multibytecodec.

    No, I haven't; I've only put the codec and map arrays into the _codecs* module state.

  5. erlend-aasland
    added 2 commits that reference this issue on Apr 17, 2023

    gh-103583: Add codecs and maps to _codecs_* module state (#103540)

    217911e

    pythongh-103583: Always pass multibyte codec structs as const

    768f98a
  6. carljm
    added 2 commits that reference this issue on Apr 17, 2023

    Merge branch 'main' into superopt

    5136459

    Merge branch 'superopt' into superopt_spec

    079c65a
  7. erlend-aasland
    added 2 commits that reference this issue on Apr 19, 2023

    gh-103583: Always pass multibyte codec structs as const (#103588)

    e989e0b

    gh-103583: Add ref. dependency between multibytecodec modules (#103589)

    a6b07b5
  8. carljm
    added a commit that references this issue on Apr 20, 2023

    Merge branch 'main' into superopt

    5c0a21c
  9. erlend-aasland commented on Apr 26, 2023

    @erlend-aasland
    erlend-aasland
    on Apr 26, 2023
    ContributorAuthor
    More actions

    @corona10, I made three competing PRs for how to implement custom module state for the CJK modules. IMO, alternative 2 is the best approach. Alt 3 is way too complex (and currently, it does not even work). Alt 1 is too hacky.

    cc. @kumaraditya303

  10. corona10 commented on Apr 26, 2023

    @corona10
    corona10
    on Apr 26, 2023
    Member
    More actions

    @erlend-aasland I will take a look by tomorrow. ;)

  11. erlend-aasland
    linked a pull request that will close this issuegh-103583: Isolate CJK codec modules #103869on Apr 26, 2023
  12. erlend-aasland
    closed this as completedin #103869on Apr 27, 2023
  13. erlend-aasland
    added a commit that references this issue on Apr 27, 2023

    gh-103583: Isolate CJK codec modules (#103869)

    8a0c7f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.