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
Taxi App Development 7.3
RentALL-Airbnb clone script 1.8.0
VisualNEO Web 19.4.5
PHP Ecommerce Script 1.3.2
dbForge Studio for PostgreSQL 2.1
Rentonn - Airbnb clone 1.0
VisualNEO for Windows 18.08.31.0
SentiVeillance SDK Trial 7.0.191272
dbForge SQL Complete 6.1
Uber for E-Scooters 1.0
ODBC Driver for MySQL 2.4
dbForge Schema Compare for MySQL 4.4
dbForge Studio for MySQL 8.1
dbForge Query Builder for MySQL 4.4
dbForge Data Compare for MySQL 5.5
Top Code
MLM Software ONE 1.5.46
PHP Ecommerce Script 1.0.4
JChartLib 1.0
OpenCV Delphi wrapper 1.0
Taxi App Development 7.3
Car Rental Script 2.0
Video Conference Website Scripts 2.86
CopySharp 1.0
Java-2-Pseudo 1.0
PHP Source Code Utility 1.0.0
Ctrlproxy 3.0.2
Nonlinear F-16 Fighter Model 1.0
GnuWin64 64
Planyo online reservation system module 6.x-1.8
Traveling Salesman Problem (TSP) using Simulated Annealing 1.0
Top Rated
Paste phpSoftPro 1.4.1
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
Availability Booking Calendar PHP 1.0
PHP GZ Blog Script 1.1
ATN Jobs Software 4.0
ATN Mall 2.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