Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
kazinator
on Dec 20, 2023
|
parent
|
context
|
favorite
| on:
I Love Ruby
Creating a new class in Python at run time is pretty easy with the three-argument form of the type function:
>>> NewClass = type('NewClass', (), {'foo':42}) >>> x = NewClass() >>> x.foo 42
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: