René's URL Explorer Experiment


Title: Export the public API explicitly and drop a context when its block raises by PetrHeinz · Pull Request #55 · logtail/logtail-python · GitHub

Open Graph Title: Export the public API explicitly and drop a context when its block raises by PetrHeinz · Pull Request #55 · logtail/logtail-python

X Title: Export the public API explicitly and drop a context when its block raises by PetrHeinz · Pull Request #55 · logtail/logtail-python

Description: Two fixes found in an end-to-end run of 0.5.0, meant for a 0.5.1 patch release. Explicit exports. Now that the package ships py.typed, type checkers take logtail/__init__.py at its word. It imports LogtailHandler, LogtailFormatter, LogtailContext and DEFAULT_CONTEXT without __all__, so the usual from logtail import LogtailHandler fails with "does not explicitly export" under mypy --strict, and with reportPrivateImportUsage in Pyright's default mode, which is what Pylance users see. Plain mypy is unaffected. 0.4.3 had no py.typed, so this is new in 0.5.0. The fix adds __all__. Leaving a context by exception. LogtailContext.__exit__ removed the context only when the block exited normally. After an exception inside with logtail.context(...), that context was attached to every later record in the process. It is now removed either way. The exception still propagates, as test_does_not_suppress_exceptions checks. This bug predates 0.5.0. The first commit adds only the tests and is expected to fail on CI. A new step in the typecheck job runs mypy --strict --follow-imports=silent on tests/typecheck/public_api.py, a file that imports and calls the API the way an application would. --follow-imports=silent hides errors inside logtail itself, just as they are hidden for an installed package. tests/test_helpers.py gets the context case. The second commit is the fix. Pyright isn't in CI because it needs Node. I checked it locally against installed wheels, outside the repo so the local source is not picked up: released 0.5.0 gives 4 errors on that file in Pyright and in mypy --strict, this branch gives 0 in both. 🤖 Generated with Claude Code

Open Graph Description: Two fixes found in an end-to-end run of 0.5.0, meant for a 0.5.1 patch release. Explicit exports. Now that the package ships py.typed, type checkers take logtail/__init__.py at its word. It import...

X Description: Two fixes found in an end-to-end run of 0.5.0, meant for a 0.5.1 patch release. Explicit exports. Now that the package ships py.typed, type checkers take logtail/__init__.py at its word. It import...

Opengraph URL: https://github.com/logtail/logtail-python/pull/55

X: @github

direct link

Domain: github.com

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:50effced-1e6b-eaff-c393-0d57e3d719f9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDF3C:2A59EB:185D03:20491D:6AFBB1BF
html-safe-nonce6a99fbed57e6d366a4269cdd4683fc95d7c899df1461cf5c25d4ca130967f8b4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjNDOjJBNTlFQjoxODVEMDM6MjA0OTFEOjZBRkJCMUJGIiwidmlzaXRvcl9pZCI6IjM0NTY5OTcxOTI0MDc2OTE3MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac503e2328154930b3d4590595d1b0e59cb6334bf3fd8020134294672735ecc374
hovercard-subject-tagpull_request:4639102457
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/logtail/logtail-python/pull/55/files
twitter:imagehttps://avatars.githubusercontent.com/u/10008612?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10008612?s=400&v=4
og:image:altTwo fixes found in an end-to-end run of 0.5.0, meant for a 0.5.1 patch release. Explicit exports. Now that the package ships py.typed, type checkers take logtail/__init__.py at its word. It import...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/logtail/logtail-python git https://github.com/logtail/logtail-python.git
octolytics-dimension-user_id78922349
octolytics-dimension-user_loginlogtail
octolytics-dimension-repository_id351343852
octolytics-dimension-repository_nwologtail/logtail-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id351343852
octolytics-dimension-repository_network_root_nwologtail/logtail-python
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
releasee4cce0e99cf61481a318ff12c2e8580153a6c7c6
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/logtail/logtail-python/pull/55/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flogtail%2Flogtail-python%2Fpull%2F55%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%2Flogtail%2Flogtail-python%2Fpull%2F55%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=logtail%2Flogtail-python
Reloadhttps://github.com/logtail/logtail-python/pull/55/files
Reloadhttps://github.com/logtail/logtail-python/pull/55/files
Reloadhttps://github.com/logtail/logtail-python/pull/55/files
logtailhttps://github.com/logtail
logtail-pythonhttps://github.com/logtail/logtail-python
Codehttps://github.com/logtail/logtail-python
Issues1 (1)https://github.com/logtail/logtail-python/issues
Pull requestshttps://github.com/logtail/logtail-python/pulls
Actionshttps://github.com/logtail/logtail-python/actions
Security and qualityhttps://github.com/logtail/logtail-python/security
Insightshttps://github.com/logtail/logtail-python/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Flogtail%2Flogtail-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Flogtail%2Flogtail-python%2Fissues%2Fnew%2Fchoose
PetrHeinzhttps://github.com/PetrHeinz
masterhttps://github.com/logtail/logtail-python/tree/master
claude/typed-exports-context-exithttps://github.com/logtail/logtail-python/tree/claude/typed-exports-context-exit
Conversation 0 https://github.com/logtail/logtail-python/pull/55
Commits 2 https://github.com/logtail/logtail-python/pull/55/commits
Checks 18 https://github.com/logtail/logtail-python/pull/55/checks
Files changed https://github.com/logtail/logtail-python/pull/55/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/55/files
Export the public API explicitly and drop a context when its block raises https://github.com/logtail/logtail-python/pull/55/files#top
Show all changes 2 commits https://github.com/logtail/logtail-python/pull/55/files
c0c3bd6 Add failing tests for the public exports and leaving a context by exc… PetrHeinz Sep 25, 2026 https://github.com/logtail/logtail-python/pull/55/commits/c0c3bd60bca66c525ce6526b3215c51e10070214
d824e62 Export the public API explicitly and drop a context when its block ra… PetrHeinz Sep 25, 2026 https://github.com/logtail/logtail-python/pull/55/commits/d824e625d746c93a4cc7f1d8d98c25bf2b576505
Clear filters https://github.com/logtail/logtail-python/pull/55/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/55/files
Please reload this pagehttps://github.com/logtail/logtail-python/pull/55/files
main.yml https://github.com/logtail/logtail-python/pull/55/files#diff-7829468e86c1cc5d5133195b5cb48e1ff6c75e3e9203777f6b2e379d9e4882b3
__init__.py https://github.com/logtail/logtail-python/pull/55/files#diff-840466d213adbf20351b066ec657e876d0a33d0ed58c19497f9ce93ab12da341
helpers.py https://github.com/logtail/logtail-python/pull/55/files#diff-ad7b437affeb5f580a1bde8ff4c1050f87507f027d8fbe5c68f8b50cbba335dd
test_helpers.py https://github.com/logtail/logtail-python/pull/55/files#diff-08a6944653efc734f4c8cb856fc854b9f21d655ca69796af2b170c53bff7919e
public_api.py https://github.com/logtail/logtail-python/pull/55/files#diff-350a1a2fb02884f99d077d981394e1d0c5219f7978b0a88fa8fa5545bf2d730a
.github/workflows/main.ymlhttps://github.com/logtail/logtail-python/pull/55/files#diff-7829468e86c1cc5d5133195b5cb48e1ff6c75e3e9203777f6b2e379d9e4882b3
View file https://github.com/logtail/logtail-python/blob/d824e625d746c93a4cc7f1d8d98c25bf2b576505/.github/workflows/main.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/55/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/55/files#diff-7829468e86c1cc5d5133195b5cb48e1ff6c75e3e9203777f6b2e379d9e4882b3
logtail/__init__.pyhttps://github.com/logtail/logtail-python/pull/55/files#diff-840466d213adbf20351b066ec657e876d0a33d0ed58c19497f9ce93ab12da341
View file https://github.com/logtail/logtail-python/blob/d824e625d746c93a4cc7f1d8d98c25bf2b576505/logtail/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/55/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/55/files#diff-840466d213adbf20351b066ec657e876d0a33d0ed58c19497f9ce93ab12da341
logtail/helpers.pyhttps://github.com/logtail/logtail-python/pull/55/files#diff-ad7b437affeb5f580a1bde8ff4c1050f87507f027d8fbe5c68f8b50cbba335dd
View file https://github.com/logtail/logtail-python/blob/d824e625d746c93a4cc7f1d8d98c25bf2b576505/logtail/helpers.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/55/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/55/files#diff-ad7b437affeb5f580a1bde8ff4c1050f87507f027d8fbe5c68f8b50cbba335dd
https://github.com/logtail/logtail-python/pull/55/files#diff-ad7b437affeb5f580a1bde8ff4c1050f87507f027d8fbe5c68f8b50cbba335dd
tests/test_helpers.pyhttps://github.com/logtail/logtail-python/pull/55/files#diff-08a6944653efc734f4c8cb856fc854b9f21d655ca69796af2b170c53bff7919e
View file https://github.com/logtail/logtail-python/blob/d824e625d746c93a4cc7f1d8d98c25bf2b576505/tests/test_helpers.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/55/{{ revealButtonHref }}
https://github.com/logtail/logtail-python/pull/55/files#diff-08a6944653efc734f4c8cb856fc854b9f21d655ca69796af2b170c53bff7919e
https://github.com/logtail/logtail-python/pull/55/files#diff-08a6944653efc734f4c8cb856fc854b9f21d655ca69796af2b170c53bff7919e
tests/typecheck/public_api.pyhttps://github.com/logtail/logtail-python/pull/55/files#diff-350a1a2fb02884f99d077d981394e1d0c5219f7978b0a88fa8fa5545bf2d730a
View file https://github.com/logtail/logtail-python/blob/d824e625d746c93a4cc7f1d8d98c25bf2b576505/tests/typecheck/public_api.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/logtail/logtail-python/pull/55/{{ revealButtonHref }}
Please reload this pagehttps://github.com/logtail/logtail-python/pull/55/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

Viewport: width=device-width


URLs of crawlers that visited me.