Search
New Code
Dynamics CRM Inventory Manager Plugin 1.0
Overstock Script 1.0.3
C# HTML to PDF 4.4.6.2
AnyGantt JS Gantt Charts 8.2.0
SentiVeillance SDK Trial 6.0.176566
Popup extension for Magento 2 2.2.x
Excel Add-in for Shopify 1.7
PHP Classified Script 1.0.3
Popup For Magento 2 2.2.x
Desktop Live Streaming SDK - Screen2Video Gold ActiveX 5.2
ODBC Driver for PostgreSQL 2.3
WooCommerce Product Customizations 1.0
Apartment Rental Software 1.0.3
Verj.io 1.1
Order ODBC Driver for MySQL 2.3
Top Code
Output Messenger 1.8.0
Aliexpress Clone- Ec21 Script 1
Indiegogo Clone 3.0
PHP Image Resize Script 1.0
Best Spotify Clone 1.0
Get Random Record Based on Weight 1.0.0
Travel Portal Script 9.29
Magento Product Designer 1.0
OFOS - Just Eat Clone Script 1.0
PrestaShop Upload Images Module 1.2.1
Trading Software 1.2.4
Deals and Discounts Website Script 1.0.2
Readymade MLM Products 2.01
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Code Listing by Eric Snow

Code 1-10 of 31   Pages: Go to  1  2  3  4  Next >>  page  






This recipe provides a descriptor and a decorator. The decorator will be used on any method in your class to indicate that you want that method to inherit its docstring.

This is useful when you are using abstract bases classes and want a method to have the same docstring as the abstract method it implements.

This recipe uses recipe #577745, the deferred_binder module.



This is a revamp of a recipe that Ned Batchelder posted on his blog a few years ago (thanks Ned!). That page is pretty insightful, recipe aside.

This recipe works for all versions of Python back to 2.4 (at least). Warning: using one...



A decorator factory is a function that returns a decorator based on the arguments you pass in. Sometimes you make a decorator factory to cover uncommon use cases. In that case you'll probably use default arguments to cover your common case.



The recipe provides an easy-to-use class for a group of "constants". It provides helper functions for getting the constant values just right. It also exposes the mechanism it uses to bind the contents of an iterable into the namespace...



This may sound too good to be true, but see for yourself. No time machines involved. Just plug in this metaclass and look for __newclass__ in your class body. It's not perfect, but the problematic corner cases are more bark than bite.



This recipe is how you can show that the Python operators and builtin functions directly use the special methods from an object's class, rather than using normal attribute lookup on the object.



Using mixin classes via inheritance has its pros and cons. Here is an easy alternative via a decorator. As a bonus, you can mix in attributes from any object, not just classes.



The only catch is that the function has to return locals() at the end. And it doesn't do the __prepare__ part of 3.x metaclasses.



Abstract Bases Classes in Python provide great features for describing interfaces programmatically. By default a subclass is validated against all its ABC parents at instantiation time (in object.__new__). This recipe aims to provide for...



Python already provides immutable versions of many of the mutable built-in types. Dict is the notable exception. Regardless, here is a protocol that objects may implement that facilitates turning immutable object mutable and vice-versa.