Enviar búsqueda
Cargar
Descriptor Protocol
•
0 recomendaciones
•
281 vistas
rocketcircus
Seguir
Tecnología
Entretenimiento y humor
Denunciar
Compartir
Denunciar
Compartir
1 de 9
Recomendados
Advanced Python, Part 1
Advanced Python, Part 1
Zaar Hai
2 + 2 = 5: Monkey-patching CPython with ctypes to conform to Party doctrine
2 + 2 = 5: Monkey-patching CPython with ctypes to conform to Party doctrine
Frankie Dintino
Introduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in Haskell
nebuta
Why you-dont-need-design-patterns-in-python
Why you-dont-need-design-patterns-in-python
Sivanagaraju Pachipulusu
purely_functional_play_framework_application
purely_functional_play_framework_application
Naoki Aoyama
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
Maulik Borsaniya
ES6 General Introduction
ES6 General Introduction
Thomas Johnston
Python decorators
Python decorators
Guillermo Blasco Jiménez
Recomendados
Advanced Python, Part 1
Advanced Python, Part 1
Zaar Hai
2 + 2 = 5: Monkey-patching CPython with ctypes to conform to Party doctrine
2 + 2 = 5: Monkey-patching CPython with ctypes to conform to Party doctrine
Frankie Dintino
Introduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in Haskell
nebuta
Why you-dont-need-design-patterns-in-python
Why you-dont-need-design-patterns-in-python
Sivanagaraju Pachipulusu
purely_functional_play_framework_application
purely_functional_play_framework_application
Naoki Aoyama
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
Maulik Borsaniya
ES6 General Introduction
ES6 General Introduction
Thomas Johnston
Python decorators
Python decorators
Guillermo Blasco Jiménez
Python Metaclasses
Python Metaclasses
Kisitu Augustine
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest
ECMA 入门
ECMA 入门
chencheng 云谦
Testing for share
Testing for share
Rajeev Mehta
Advanced python
Advanced python
EU Edge
Fantastic DSL in Python
Fantastic DSL in Python
kwatch
ddd+scala
ddd+scala
潤一 加藤
Namespaces
Namespaces
zindadili
20170113 julia’s type system and multiple dispatch
20170113 julia’s type system and multiple dispatch
岳華 杜
Declarative Data Modeling in Python
Declarative Data Modeling in Python
Joshua Forman
JavaScript for PHP developers
JavaScript for PHP developers
Stoyan Stefanov
Python decorators
Python decorators
Alex Su
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Samuel Fortier-Galarneau
Decorators in Python
Decorators in Python
Ben James
Python classes objects
Python classes objects
Smt. Indira Gandhi College of Engineering, Navi Mumbai, Mumbai
Swift 3 Programming for iOS : extension
Swift 3 Programming for iOS : extension
Kwang Woo NAM
Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!
Kel Cecil
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
James Titcumb
TypeScript Introduction
TypeScript Introduction
Dmitry Sheiko
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
hwilming
Food
Food
k_iribar
Unit5 jesus
Unit5 jesus
lola caravaca
Más contenido relacionado
La actualidad más candente
Python Metaclasses
Python Metaclasses
Kisitu Augustine
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest
ECMA 入门
ECMA 入门
chencheng 云谦
Testing for share
Testing for share
Rajeev Mehta
Advanced python
Advanced python
EU Edge
Fantastic DSL in Python
Fantastic DSL in Python
kwatch
ddd+scala
ddd+scala
潤一 加藤
Namespaces
Namespaces
zindadili
20170113 julia’s type system and multiple dispatch
20170113 julia’s type system and multiple dispatch
岳華 杜
Declarative Data Modeling in Python
Declarative Data Modeling in Python
Joshua Forman
JavaScript for PHP developers
JavaScript for PHP developers
Stoyan Stefanov
Python decorators
Python decorators
Alex Su
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Samuel Fortier-Galarneau
Decorators in Python
Decorators in Python
Ben James
Python classes objects
Python classes objects
Smt. Indira Gandhi College of Engineering, Navi Mumbai, Mumbai
Swift 3 Programming for iOS : extension
Swift 3 Programming for iOS : extension
Kwang Woo NAM
Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!
Kel Cecil
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
James Titcumb
TypeScript Introduction
TypeScript Introduction
Dmitry Sheiko
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
hwilming
La actualidad más candente
(20)
Python Metaclasses
Python Metaclasses
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
CodeFest 2010. Иноземцев И. — Fantom. Cross-VM Language
ECMA 入门
ECMA 入门
Testing for share
Testing for share
Advanced python
Advanced python
Fantastic DSL in Python
Fantastic DSL in Python
ddd+scala
ddd+scala
Namespaces
Namespaces
20170113 julia’s type system and multiple dispatch
20170113 julia’s type system and multiple dispatch
Declarative Data Modeling in Python
Declarative Data Modeling in Python
JavaScript for PHP developers
JavaScript for PHP developers
Python decorators
Python decorators
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Decorators in Python
Decorators in Python
Python classes objects
Python classes objects
Swift 3 Programming for iOS : extension
Swift 3 Programming for iOS : extension
Hey! There's OCaml in my Rust!
Hey! There's OCaml in my Rust!
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
TypeScript Introduction
TypeScript Introduction
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Destacado
Food
Food
k_iribar
Unit5 jesus
Unit5 jesus
lola caravaca
Especies Invasoras 2016 IES Rambla de Nogalte
Especies Invasoras 2016 IES Rambla de Nogalte
Txema Campillo
Thesis i 3.21.11
Thesis i 3.21.11
alimac326
Ad Libitum 07
Ad Libitum 07
soumitroy
Bader ufo3
Bader ufo3
gorin2008
HR Development Acedemy, Znalostný manažment a sociálne siete
HR Development Acedemy, Znalostný manažment a sociálne siete
VIRTA s.r.o.
Facebook Presentatie
Facebook Presentatie
Thomas Cappelle
Sinonimos y antonimos
Sinonimos y antonimos
alan254
PeopleZone
PeopleZone
CodeZone
Ardora tutorial sopa de letras
Ardora tutorial sopa de letras
UNICIENCIA
How deep is your love
How deep is your love
evei
Living things pedro
Living things pedro
lola caravaca
Majestic 05
Majestic 05
gorin2008
Trabajo science sofia t 6
Trabajo science sofia t 6
lola caravaca
Hilton International Training.
Hilton International Training.
Hilton
Alien digest vol_1
Alien digest vol_1
gorin2008
La prehistoria
La prehistoria
lola caravaca
Sectors of the economy alonso
Sectors of the economy alonso
lola caravaca
Bader ufo3
Bader ufo3
gorin2008
Destacado
(20)
Food
Food
Unit5 jesus
Unit5 jesus
Especies Invasoras 2016 IES Rambla de Nogalte
Especies Invasoras 2016 IES Rambla de Nogalte
Thesis i 3.21.11
Thesis i 3.21.11
Ad Libitum 07
Ad Libitum 07
Bader ufo3
Bader ufo3
HR Development Acedemy, Znalostný manažment a sociálne siete
HR Development Acedemy, Znalostný manažment a sociálne siete
Facebook Presentatie
Facebook Presentatie
Sinonimos y antonimos
Sinonimos y antonimos
PeopleZone
PeopleZone
Ardora tutorial sopa de letras
Ardora tutorial sopa de letras
How deep is your love
How deep is your love
Living things pedro
Living things pedro
Majestic 05
Majestic 05
Trabajo science sofia t 6
Trabajo science sofia t 6
Hilton International Training.
Hilton International Training.
Alien digest vol_1
Alien digest vol_1
La prehistoria
La prehistoria
Sectors of the economy alonso
Sectors of the economy alonso
Bader ufo3
Bader ufo3
Similar a Descriptor Protocol
DjangoCon US 2011 - Monkeying around at New Relic
DjangoCon US 2011 - Monkeying around at New Relic
Graham Dumpleton
Djangocon11: Monkeying around at New Relic
Djangocon11: Monkeying around at New Relic
New Relic
Object Orientation vs Functional Programming in Python
Object Orientation vs Functional Programming in Python
Tendayi Mawushe
Pybelsberg — Constraint-based Programming in Python
Pybelsberg — Constraint-based Programming in Python
Christoph Matthies
Python_Unit_2 OOPS.pptx
Python_Unit_2 OOPS.pptx
ChhaviCoachingCenter
Python's magic methods
Python's magic methods
Reuven Lerner
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Fwdays
Object_Oriented_Programming_Unit3.pdf
Object_Oriented_Programming_Unit3.pdf
Koteswari Kasireddy
Pyimproved again
Pyimproved again
rik0
Python decorators (中文)
Python decorators (中文)
Yiwei Chen
Design of OO language
Design of OO language
Georgiana T.
Dive into Python Class
Dive into Python Class
Jim Yeh
Python magicmethods
Python magicmethods
dreampuf
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
Workhorse Computing
用Tornado开发RESTful API运用
用Tornado开发RESTful API运用
Felinx Lee
Introduction to php oop
Introduction to php oop
baabtra.com - No. 1 supplier of quality freshers
Introduction to Python
Introduction to Python
UC San Diego
Python_Object_Oriented_Programming.pptx
Python_Object_Oriented_Programming.pptx
Koteswari Kasireddy
Introduction to Python - Part Three
Introduction to Python - Part Three
amiable_indian
Python Descriptors Demystified
Python Descriptors Demystified
Chris Beaumont
Similar a Descriptor Protocol
(20)
DjangoCon US 2011 - Monkeying around at New Relic
DjangoCon US 2011 - Monkeying around at New Relic
Djangocon11: Monkeying around at New Relic
Djangocon11: Monkeying around at New Relic
Object Orientation vs Functional Programming in Python
Object Orientation vs Functional Programming in Python
Pybelsberg — Constraint-based Programming in Python
Pybelsberg — Constraint-based Programming in Python
Python_Unit_2 OOPS.pptx
Python_Unit_2 OOPS.pptx
Python's magic methods
Python's magic methods
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Object_Oriented_Programming_Unit3.pdf
Object_Oriented_Programming_Unit3.pdf
Pyimproved again
Pyimproved again
Python decorators (中文)
Python decorators (中文)
Design of OO language
Design of OO language
Dive into Python Class
Dive into Python Class
Python magicmethods
Python magicmethods
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
用Tornado开发RESTful API运用
用Tornado开发RESTful API运用
Introduction to php oop
Introduction to php oop
Introduction to Python
Introduction to Python
Python_Object_Oriented_Programming.pptx
Python_Object_Oriented_Programming.pptx
Introduction to Python - Part Three
Introduction to Python - Part Three
Python Descriptors Demystified
Python Descriptors Demystified
Más de rocketcircus
Pytables
Pytables
rocketcircus
Descriptor Protocol
Descriptor Protocol
rocketcircus
Python Academy
Python Academy
rocketcircus
intro to scikits.learn
intro to scikits.learn
rocketcircus
AWS Quick Intro
AWS Quick Intro
rocketcircus
PyPy 1.5
PyPy 1.5
rocketcircus
Message Queues
Message Queues
rocketcircus
Rocket Circus on Code Review
Rocket Circus on Code Review
rocketcircus
Más de rocketcircus
(8)
Pytables
Pytables
Descriptor Protocol
Descriptor Protocol
Python Academy
Python Academy
intro to scikits.learn
intro to scikits.learn
AWS Quick Intro
AWS Quick Intro
PyPy 1.5
PyPy 1.5
Message Queues
Message Queues
Rocket Circus on Code Review
Rocket Circus on Code Review
Último
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Pixlogix Infotech
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Safe Software
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
soniya singh
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Padma Pradeep
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Allon Mureinik
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Pooja Nehwal
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Paola De la Torre
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Delhi Call girls
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
shyamraj55
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Patryk Bandurski
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
Softradix Technologies
Último
(20)
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
Descriptor Protocol
1.
Descriptors jss
2011-07-07
2.
What can you
do inside a class suite?
3.
@c_decorator1
@c_decorator0(foo=23) class Foo(object): __metaclass__ = MetaClass wenglo = 0 garply, corge = mktuple(qux) @staticmethod def fred(): pass def __new__(klass): pass All In One: @classmethod def wilma(klass): pass def __init__(self, *_): pass @f_decorator def foo(self, *_): pass @property def bar(self): pass @bar.setter def set_bar(self, v): pass helga = Descriptor() print locals()
4.
@c_decorator1
@c_decorator0(foo=23) class Foo(object): __metaclass__ = MetaClass wenglo = 0 garply, corge = mktuple(qux) @staticmethod def fred(): pass def __new__(klass): pass All In One: @classmethod def wilma(klass): pass def __init__(self, *_): pass @f_decorator def foo(self, *_): pass @property def bar(self): pass @bar.setter def set_bar(self, v): pass helga = Descriptor() print locals()
5.
Descriptor Protocol •
Descriptors are customized Object Attributes • An object with any of these defined is a descriptor: __get__(self, obj, type=None) __set__(self, obj, val) __delete__(self, obj)
6.
Generic Descriptor Examples class
Foo(object): def wenglo(self): f = Foo() return self.qux f.wenglo() @classmethod Foo.foo() def foo(klass): Foo.wenglo() return klass.bar @staticmethod def buz(): return 42
7.
“Normal” attribute access class
Foo(object): pass f = Foo() f.bla # implemented in object.__getattribute__: == type(f).__dict__[‘bla’].__get__(f, type(f))
8.
Demo
show some code: check out ListProperty in postamt.py
9.
Implementing property() # by
Raymond Hettinger: http://users.rcn.com/python/download/Descriptor.htm class property(object): def __init__(self, fget=None, fset=None, fdel=None, doc=None): self.fget = fget self.fset = fset self.fdel = fdel self.__doc__ = doc def __get__(self, obj, objtype=None): if obj is None: return self if self.fget is None: raise AttributeError, "unreadable attribute" return self.fget(obj) def __set__(self, obj, value): if self.fset is None: raise AttributeError, "can't set attribute" self.fset(obj, value) def __delete__(self, obj): if self.fdel is None: raise AttributeError, "can't delete attribute" self.fdel(obj)