Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
phpEnter 5.1.
Udemy Clone script 2.01
VisualNEO Web 19.11.7
VisualNEO for Windows 19.4.29.0
SentiVeillance SDK Trial 7.3
Devart ODBC Driver for PostgreSQL 3.2
SecureBridge 9.2
dotConnect for QuickBooks 1.9
dotConnect for Magento 1.9
dotConnect for Zoho CRM 1.10
dotConnect for FreshBooks 1.10
IP2Location Geolocation Database January.2020
dotConnect for BigCommerce 1.10
HTMLPad 2020 16.0
WeBuilder 2020 16.0
Top Code
SecureBridge 8.0
IP2Location Geolocation Database January.2020
ATN Site Builder 3.0
ATN Resume Finder 2.0
PHP Review Script 1.0
ICPennyBid Penny Auction Script 4.0
Invoice Manager by PHPJabbers 3.0
Devart ODBC Driver for PostgreSQL 3.2
Aglowsoft SQL Query Tools 8.2
Classified Ad Lister 1.0
Solid File System OS edition 5.1
ADO.NET Provider for ExactTarget 1.0
Bytescout PDF To HTML SDK 9.0.0.3079
TAdvGlowButton 1.2
SecureCI 2011.1.0
Top Rated
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
compare(), making filter() fun again 
File ID: 65255






compare(), making filter() fun again 
Download compare(), making filter() fun again http://code.activestate.com/recipes/576527-freeze-make-any-object-immutable/?in=lang-pythonReport Error Link
License: Freeware
Downloads: 2
Submit Rating:
compare(), making filter() fun again  Description
Description: compare() takes a function parameter and returns a callable comparator when compared to a value. When called, the comparator returns result of comparing the result of calling the function and the value it was created with.

Basic usage:

items = [1, 2, 3, 4, 5]

def double(x):
return x * 2

for i in filter(compare(double) > 5, items):
print i #Prints 3, 4 and 5

License: Freeware

Related: Compare, Filter, Functional, lambda

O/S:Windows

Downloads: 2



More Similar Code

Adaptive Object Model Framework: define your object model in XML, create easy pluggable components, easily adapt to changing requirements, make programming fun again.



Prevent WordPress from displaying single and double quotation marks as their curly alternatives.

Despite the unfortunately misleading name, this plugin is NOT the antithesis of WordPress's wptexturize() function. This ONLY prevents...



Graphviz Filter is a fun little filter that treats input text as Graphviz DOT syntax, converts it using Graphviz tools to the requested format(s) and renders it in HTML. It's useful to quickly create graphs dynamically from within Drupal nodes. A...



This module adds a filter for making text corresponding to russian typographic rules.



Iframe Filter allows to embed content into an iframe. Normally externally loaded content like website widgets can slow down the loading of your website or making it crash if the page from where the content is loaded fails.

Iframe Filter...



With this effect your transitions go trough an amazing pixelation process making this a unique filter for all your bitmap manipulations in 'Flash 8' and 'Flash CS3'.

The pixelation of your image will increasingly get larger during the...



This script adds flare and draws attention to important text on your page by making it glow.

It utilizes the glow filter of DHTML to first surround any text with a yellow "light", then uses scripting to make the light...



Datafeed Studio converts your merchant datafeeds into dynamic money-making websites and comes with out of the box support for rapid building of the following types of affiliate based web site:
- Niche Online Stores
- Price Compare...



Transposh translation filter for WordPress offers a unique approach to blog translation. It allows your blog to combine automatic translation with human translation aided by your users with an easy to use in-context interface.

Transposh...



Taking a leaf out of the book of Amelie Poulain it is time to get rid of Internet Explorer 6 by making it uncomfortable for the end users and blaming something else. To this end we take an IE filter that was made to confuse users d-deOCL the...

User Review for compare(), making filter() fun again
- required fields
     

Please enter text on the image