René's URL Explorer Experiment


Title: Python sketches are not Pythonic · Issue #230 · processing/libprocessing · GitHub

Open Graph Title: Python sketches are not Pythonic · Issue #230 · processing/libprocessing

X Title: Python sketches are not Pythonic · Issue #230 · processing/libprocessing

Description: Sorry for the vague title, feel free to update it. Using https://github.com/processing/processing-examples-mewnala/blob/6e416d80852ee9e147b70ae93cbf8f6dda871ba3/Basics/Structure/Redraw/Redraw.py as an example, a mewnala sketch structure ...

Open Graph Description: Sorry for the vague title, feel free to update it. Using https://github.com/processing/processing-examples-mewnala/blob/6e416d80852ee9e147b70ae93cbf8f6dda871ba3/Basics/Structure/Redraw/Redraw.py as...

X Description: Sorry for the vague title, feel free to update it. Using https://github.com/processing/processing-examples-mewnala/blob/6e416d80852ee9e147b70ae93cbf8f6dda871ba3/Basics/Structure/Redraw/Redraw.py as...

Opengraph URL: https://github.com/processing/libprocessing/issues/230

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python sketches are not Pythonic","articleBody":"_Sorry for the vague title, feel free to update it._\n\nUsing https://github.com/processing/processing-examples-mewnala/blob/6e416d80852ee9e147b70ae93cbf8f6dda871ba3/Basics/Structure/Redraw/Redraw.py as an example, a mewnala sketch structure and common techniques has several issues that makes it less ideal as Python code:\n\n* Sharing state between frames requires the use of `global`\n* Even when wildcard import is removed, some variables are injected at the runtime and linters catch them as \"undefined\":\n  * https://github.com/processing/libprocessing/issues/150\n* `setup` function is not meaningful, the same results can be achieved just without. Using `setup` to initialize variables etc. causes even more undefined issues because how scopes work in Python.\n\nAs an alternative, a class based approach can solve all these issues:\n\n```python\nfrom mewnala import (\n    Line,\n    Sketch as BaseSketch,\n)\n\nclass Sketch(BaseSketch):\n    def __init__(self, width=640, height=480):\n        super().__init__()\n\n        self.width = width\n        self.height = height\n\n    def setup(self):\n        self.size = (self.width, self.height)\n        self.stroke = 255\n        self.loop = False\n\n        self.y = 180\n\n    def draw(self):\n        self.background = 0\n\n        self.y -= 4\n        if self.y \u003c 0:\n            self.y = self.height\n\n        line = Line(0, self.y, self.width, self.y)\n        line.draw()\n\n    def mouse_pressed(self):\n        self.redraw()\n\n\nif __name__ == \"__main__\":\n    sketch = Sketch(width=1920, height=1080)\n    sketch.run()\n```\n\nNo more magic imports, no more undefined variables, and now the sketch has a Python-native syntax feel much more natural comparing to the previous version.\n\n_I removed the setter function calls too, it's a Java-native pattern and feels weird with Python._\n\nWe can go one step further and eliminate the `setup()` What does it do for the sketch can be covered by `__init__` in a class context.","author":{"url":"https://github.com/ulgens","@type":"Person","name":"ulgens"},"datePublished":"2026-08-12T12:29:50Z","url":"https://github.com/processing/libprocessing/issues/230"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9236054d-48a1-329e-caf8-2573abcdacac
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB920:3C6858:1246C3:187433:6B05F763
html-safe-nonce252679afb6e5b721a6e8686eadacf0eccbaf4dde87ba9a9e7ef278e5f6b3a513
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTIwOjNDNjg1ODoxMjQ2QzM6MTg3NDMzOjZCMDVGNzYzIiwidmlzaXRvcl9pZCI6IjkxMDc1NDQzMzQxMTQ2MTcxODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace529ccc51ac9e1e53c869377f7f08b3ca5e1bf66b646a1c7d9c4962cc547eb78
hovercard-subject-tagissue:5130882659
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/processing/libprocessing/230/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4e5632293360e2d42661577cb46cde597dcfd17967978107081f17bfe3a32936/processing/libprocessing/issues/230
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4e5632293360e2d42661577cb46cde597dcfd17967978107081f17bfe3a32936/processing/libprocessing/issues/230
og:image:altSorry for the vague title, feel free to update it. Using https://github.com/processing/processing-examples-mewnala/blob/6e416d80852ee9e147b70ae93cbf8f6dda871ba3/Basics/Structure/Redraw/Redraw.py as...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameulgens
hostnamegithub.com
expected-hostnamegithub.com
Nonec214754a6652274794ed4e054a7b71be999d69843f103ba54893001d45010ece
turbo-cache-controlno-preview
go-importgithub.com/processing/libprocessing git https://github.com/processing/libprocessing.git
octolytics-dimension-user_id1617169
octolytics-dimension-user_loginprocessing
octolytics-dimension-repository_id1101329545
octolytics-dimension-repository_nwoprocessing/libprocessing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1101329545
octolytics-dimension-repository_network_root_nwoprocessing/libprocessing
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7d164a4e71eb333b2b17fd5b17e18efb7855505c
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/processing/libprocessing/issues/230#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprocessing%2Flibprocessing%2Fissues%2F230
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%2Fprocessing%2Flibprocessing%2Fissues%2F230
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=processing%2Flibprocessing
Reloadhttps://github.com/processing/libprocessing/issues/230
Reloadhttps://github.com/processing/libprocessing/issues/230
Reloadhttps://github.com/processing/libprocessing/issues/230
processinghttps://github.com/processing
libprocessinghttps://github.com/processing/libprocessing
Codehttps://github.com/processing/libprocessing
Issues67 (67)https://github.com/processing/libprocessing/issues
Pull requests10 (10)https://github.com/processing/libprocessing/pulls
Actionshttps://github.com/processing/libprocessing/actions
Projectshttps://github.com/processing/libprocessing/projects
Wikihttps://github.com/processing/libprocessing/wiki
Security and qualityhttps://github.com/processing/libprocessing/security
Insightshttps://github.com/processing/libprocessing/insights
https://github.com/processing/libprocessing
New issuehttps://github.com/login?return_to=https://github.com/processing/libprocessing/issues/230
New issuehttps://github.com/login?return_to=https://github.com/processing/libprocessing/issues/230
Python sketches are not Pythonichttps://github.com/processing/libprocessing/issues/230#top
https://github.com/ulgens
ulgenshttps://github.com/ulgens
on Aug 12, 2026https://github.com/processing/libprocessing/issues/230#issue-5130882659
https://github.com/processing/processing-examples-mewnala/blob/6e416d80852ee9e147b70ae93cbf8f6dda871ba3/Basics/Structure/Redraw/Redraw.pyhttps://github.com/processing/processing-examples-mewnala/blob/6e416d80852ee9e147b70ae93cbf8f6dda871ba3/Basics/Structure/Redraw/Redraw.py
mewnala: mewnala.math, width and height is still being reported as undefined syntax error on VS Code #150https://github.com/processing/libprocessing/issues/150
ulgenshttps://github.com/ulgens
on Aug 12, 2026https://github.com/processing/libprocessing/issues/230#event-29339745802
https://github.com/ksen0
ksen0https://github.com/ksen0
on Aug 14, 2026https://github.com/processing/libprocessing/issues/230#issuecomment-5293236104
original sketchhttps://github.com/processing/processing-examples-mewnala/blob/6e416d80852ee9e147b70ae93cbf8f6dda871ba3/Basics/Structure/Redraw/Redraw.py
https://github.com/ulgens
ulgenshttps://github.com/ulgens
on Aug 14, 2026https://github.com/processing/libprocessing/issues/230#issuecomment-5294838656
https://py5coding.org/content/py5_modes.html#imported-modehttps://py5coding.org/content/py5_modes.html#imported-mode
https://py5coding.org/content/py5_modes.html#class-modehttps://py5coding.org/content/py5_modes.html#class-mode
ulgenshttps://github.com/ulgens
on Aug 16, 2026https://github.com/processing/libprocessing/issues/230#event-29511863356
Convert unit 02 sketches to "class mode"https://github.com/ulgens/designing-with-python/commit/87fafa4973ca45afabaa861c6a10d72ef5accb65
87fafa4https://github.com/ulgens/designing-with-python/commit/87fafa4973ca45afabaa861c6a10d72ef5accb65
Convert unit 02 sketches to "class mode"https://github.com/ulgens/designing-with-python/commit/560bdb8285a4237fae6570429df50ff9d666d838
560bdb8https://github.com/ulgens/designing-with-python/commit/560bdb8285a4237fae6570429df50ff9d666d838
Sign up for freehttps://github.com/signup?return_to=https://github.com/processing/libprocessing/issues/230
Sign in to commenthttps://github.com/login?return_to=https://github.com/processing/libprocessing/issues/230
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-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.