Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Metaclass
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|A metaclass describes commen behaviour for classes, like a class does for objects}} {{multiple issues| {{original research|date=September 2013}} {{more citations needed|date=September 2013}} }} In [[object-oriented programming]], a '''metaclass''' is a [[Class (computer science)|class]] whose [[Instance (computer programming)|instances]] are classes themselves. Unlike ordinary classes, which define the behaviors of objects, metaclasses specify the behaviors of classes and their instances. Not all object-oriented [[programming languages]] support the concept of metaclasses. For those that do, the extent of control metaclasses have over class behaviors varies. Metaclasses are often implemented by treating classes as [[first-class citizen|first-class citizens]], making a metaclass an object that creates and manages these classes. Each programming language adheres to its own [[metaobject protocol]], which are the rules that determine interactions among objects, classes, and metaclasses.<ref>{{cite book|author=Ira R. Forman and Scott Danforth|title=Putting Metaclasses to Work|year=1999|publisher=Addison-Wesley |isbn=0-201-43305-2}}</ref> Metaclasses are utilized to automate code generation and to enhance framework development.<ref>{{cite book |last1=AloorRavi |first1=Sulekha |title=Metaprogramming with Python |date=2022 |publisher=Packt Publishing |location=Birmingham}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)