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 — Runtime fixes for pyrevit.forms under CPython (pyRevit #3846) by romangolev · Pull Request #4 · pyrevitlabs/pythonnet

Conversation

@romangolev

@romangolev romangolev commented Nov 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Review PR for the pythonnet changes behind pyrevitlabs/pyRevit#3846 (pyrevit.forms under CPython).

pyRevit 7.0.1 pins this fork at f591d92 (the base branch, pyrevit-7). pyrevitlabs/pyRevit#3846 moves the dev/modules/pyRevitLabs.Python.Net submodule to 173f533 and updates the PythonNet DLLs in dev/libs. These 13 commits were pushed straight to pyrevit-5-main, which already contains them; this PR exists so they can be reviewed and linked from pyrevitlabs/pyRevit#3846.

Changes

Derived CLR types

  • Generated subclass types are cached, keyed on their explicit CLR members and full shape, so redefining a Python class (script reloads) reuses a matching type instead of failing; derived types keep their names.
  • Interface-only Python classes get a derived managed type and no longer need __namespace__; interface types are keyed by defining file.
  • Inherited interface members are implemented on derived types.
  • Class-creation hooks (__set_name__, __init_subclass__) run for derived types.

Conversions

  • Python truthiness converts to bool targets.
  • Python object maps to System.Object as a generic argument.
  • Disposable CLR objects work as context managers (with).

Codecs

  • Codecs registered after the first conversion take effect.
  • Codecs are queried outside the registry lock.

Tests

  • CLR class redefinition is covered, with a fixture for it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
romangolev added 13 commits October 27, 2026 10:11
@romangolev
fix(runtime): cache generated CLR subclass types
64083b3
@romangolev
test(runtime): cover CLR class redefinition
568a31b
@romangolev
fix(runtime): key derived-type cache on explicit CLR members
fc80dc7
Redefinitions that change clrmethod or clrproperty members get a fresh
type, and Reset() clears the cache.
@romangolev
test(runtime): add the class redefinition fixture
6bdb554
@romangolev
fix(runtime): keep derived CLR type names and key cache on full shape
b56536c
Types keep __namespace__.Name so they stay importable; only a differing shape gets a hash suffix.
@romangolev
fix(codecs): honor codecs registered after the first conversion
4727968
@romangolev
feat(runtime): convert Python truthiness to bool targets
f3e5349
@romangolev
feat(runtime): derive managed types for interface-only classes
2adeed8
@romangolev
fix(runtime): implement inherited interface members in derived types
7e17240
Interface-only classes fall back to a plain type if generation fails, so imports never break.
@romangolev
fix(runtime): map Python object to System.Object as a generic argument
f943bfd
@romangolev
feat(runtime): use disposable CLR objects as context managers
0cad232
@romangolev
fix(codecs): ask codecs outside the registry lock
e4e05a1
A codec that runs Python could deadlock against a thread holding the GIL.
@romangolev
fix(runtime): run class-creation hooks and key interface types by file
173f533
cached_property works, and same-named classes from different scripts no longer share a type.
@romangolev romangolev mentioned this pull request Nov 3, 2026
feat(forms): support pyrevit.forms under CPython pyrevitlabs/pyRevit#3846
Open
3 tasks done
@romangolev
fix(runtime): invalidate the type cache after wrapping __class_getitem__
dfad7bf

This branch has not been deployed

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@romangolev
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.