René's URL Explorer Experiment


Title: [Draft/RFC] ifcopenshell-python: generated typed IFC4 stubs for schema-aware by_type() by petruconduraru · Pull Request #8698 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: [Draft/RFC] ifcopenshell-python: generated typed IFC4 stubs for schema-aware by_type() by petruconduraru · Pull Request #8698 · IfcOpenShell/IfcOpenShell

X Title: [Draft/RFC] ifcopenshell-python: generated typed IFC4 stubs for schema-aware by_type() by petruconduraru · Pull Request #8698 · IfcOpenShell/IfcOpenShell

Description: Draft, not requesting merge, sharing for feedback on the direction. Addresses the typing idea from #3306. @aothms your comment there sketched hand-written Optional/Type[T] classes for 3 entities as a proof of concept. This generates the same shape for all 776 IFC4 entities directly from the compiled schema (ifcopenshell_wrapper.schema_by_name, the same source file.by_type() itself uses), rather than parsing .exp files: entity inheritance, defined types, enumerations as Literal, SELECTs as Union, aggregates, inverse attributes, and a file.by_type() overload set (Literal["IfcWall"] -> list[IfcWall] for all 776 classes, usable today via cast("ifc4.file", model), plus a type[T] overload for future runtime support). Pure stub file (ifcopenshell/ifc4.pyi), zero runtime changes, verified with ty (the CI-pinned checker): your y()/z() narrowing example from the issue now passes/fails exactly as expected, and running it against the full ifcopenshell-python tree adds no measurable checker time. Only IFC4 generated so far. Natural next steps if this direction is useful: IFC2X3/IFC4X3, a CI regen check, and a small runtime shim to make the type[T] overload actually executable. Wanted your take before going further. Generated with the assistance of an AI coding tool.

Open Graph Description: Draft, not requesting merge, sharing for feedback on the direction. Addresses the typing idea from #3306. @aothms your comment there sketched hand-written Optional/Type[T] classes for 3 entities as...

X Description: Draft, not requesting merge, sharing for feedback on the direction. Addresses the typing idea from #3306. @aothms your comment there sketched hand-written Optional/Type[T] classes for 3 entities as...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8698

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d8552fc6-1a8f-d295-0553-fa6e57b89d40
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB47C:25853D:26D3EF:33868D:6B04B622
html-safe-nonce8d0fde965437bf16a67a5f3b53dbf31bbc10e44b9dc9236fa2231206b9874bf9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDdDOjI1ODUzRDoyNkQzRUY6MzM4NjhEOjZCMDRCNjIyIiwidmlzaXRvcl9pZCI6IjUwMjk5ODUyMzMyMTEyNzQ3ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1c945ed0a6e7bb7b41dc6e5641cacc6d64254706a783ca8f4952c4b6a6ccc136
hovercard-subject-tagpull_request:4076015591
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
twitter:imagehttps://avatars.githubusercontent.com/u/139251053?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/139251053?s=400&v=4
og:image:altDraft, not requesting merge, sharing for feedback on the direction. Addresses the typing idea from #3306. @aothms your comment there sketched hand-written Optional/Type[T] classes for 3 entities as...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb032e77f1ea437ede6c115446a0a467709b468e7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fpull%2F8698%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fpull%2F8698%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests940 (940)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
Sign up for GitHub https://github.com/signup?return_to=%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2Fnew%2Fchoose
petruconduraruhttps://github.com/petruconduraru
IfcOpenShell:v0.9.0https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.9.0
BIMvoice:fix-3306-typed-ifc4-stubshttps://github.com/BIMvoice/IfcOpenShell/tree/fix-3306-typed-ifc4-stubs
Conversation 4 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698
Commits 6 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/commits
Checks 8 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/checks
Files changed https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
[Draft/RFC] ifcopenshell-python: generated typed IFC4 stubs for schema-aware by_type() https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#top
Show all changes 6 commits https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
f15eb24 ifcopenshell-python: generate typed IFC4 stubs for schema-aware by_ty… petruconduraru Jul 17, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/commits/f15eb2452979cf7621a96efc90a4b93f3dddebf1
940aebd ifcopenshell-python: prototype cross-schema by_type() narrowing (#8698) petruconduraru Jul 19, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/commits/940aebd928424dd76253e34664be14f5750b534c
01c4981 ifcopenshell-python: entity_instance.schema for instance-level narrow… petruconduraru Jul 19, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/commits/01c4981fbde4e7ebb8ede206fca448e6e4fd71fa
225684f Merge v0.9.0 into PR 8698 branch petruconduraru Sep 29, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/commits/225684fc88ebb592b915f1bff798ed43a887c668
c17240e Cast by_type() result to tuple in typing test petruconduraru Sep 29, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/commits/c17240e8dc0f861c75d314c9a1eb4e89031e2b0f
b9c3d3e Merge origin/v0.9.0 into fix-3306-typed-ifc4-stubs petruconduraru Sep 30, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/commits/b9c3d3e53e5a0f2512651563879f3502ae97bd80
Clear filters https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
entity_instance.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-b63197ec4d064fc4387ed3f1b8becdbf26fc1c441afea3a07e701d384134a2f7
ifc4.pyi https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-08bb81066f9c6a2859987473feb19e8eb3dcf5b3d1ab24b57ab4eef59b4b38b2
ifc4x3.pyi https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-3437b51cccb92fdfe0c66ce770d263971d3cb21e9d00bb65cf8841adc3d7a176
generate_typed_stubs.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-a375e9c05b15322c5abb2bb6d43a0b62be83ef0c1d56aa4182c52d2db28ca471
typing_tests.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-96cabfd410740bb3f250d104423a95f5d23e5409a34560cde1b11fe2a891e0fe
src/ifcopenshell-python/ifcopenshell/entity_instance.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-b63197ec4d064fc4387ed3f1b8becdbf26fc1c441afea3a07e701d384134a2f7
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/b9c3d3e53e5a0f2512651563879f3502ae97bd80/src/ifcopenshell-python/ifcopenshell/entity_instance.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-b63197ec4d064fc4387ed3f1b8becdbf26fc1c441afea3a07e701d384134a2f7
https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-b63197ec4d064fc4387ed3f1b8becdbf26fc1c441afea3a07e701d384134a2f7
https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-b63197ec4d064fc4387ed3f1b8becdbf26fc1c441afea3a07e701d384134a2f7
https://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files#diff-b63197ec4d064fc4387ed3f1b8becdbf26fc1c441afea3a07e701d384134a2f7
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8698/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.