[Edu-sig] Abducted by Decorators (niche market, esoteric TV allusions)

kirby urner kirby.urner at gmail.com
Tue Apr 8 00:59:36 CEST 2014


"""
Learning about Decorators
"Just for the fun of it" -- OCN

Decorators as Abductors

I'm thinking in terms of a specific (aborted) TV series,
but the pattern:

me = Abduct(me)  # @Abduct a callable

has generic resonance as a metaphor.

Specifically:

http://en.wikipedia.org/wiki/Invasion_%28TV_series%29

Storyline (from imdb.com)

In the aftermath of a hurricane, a Florida Park Ranger and his family
deal with strange occurrences, including luminescent creatures in
the water and people that somehow seem to have changed after
surviving the night of the disaster out in the open. Written by Anonymous

Wikipedia:

In Bulgaria, Invasion premiered on February 21, 2007,
on Nova Television and in Romania it premiered on
March 10, 2009, on Pro Cinema movie channel.

OUTPUT:

She loves her babies.
She loves her babies (not!).

"""

def Floridian(s):  # this all happens in Florida
    return s

# BEFORE:

print( Floridian("She loves her babies."))

def Alien(f): # A is for Abduction
    """luminiscent creature in the water"""
    def FauxFloridian(s): # a clone
        return s[:-1] + " (not!)." # a change
    return FauxFloridian

@Alien
def Floridian(s):  # same function
    return s

# AFTER:

# she = Dr. Mariel Underlay
print( Floridian("She loves her babies."))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20140407/e44afd8e/attachment.html>


More information about the Edu-sig mailing list