• Home
  • About
    • About The Coder
    • Language List
  • The Rules
    • Rule #1: Clarity Trumps Everything
    • Rule #2: Source Code is for Humans
    • Rule #3: Don’t Ignore Warnings
    • Rule #4: Comment As You Go!
    • Rule #5: Always Use Parentheses
  • CS-101
  • Guestbook

The Hard-Core Coder

~ I just can't stop writing code!

The Hard-Core Coder

Tag Archives: Python decorator

Python Decorators, part 2

25 Saturday Apr 2020

Posted by Wyrd Smythe in CS101

≈ Leave a comment

Tags

Aspect-Oriented Programming, computer language, programming language, Python, Python code, Python decorator

Last time I began exploring Python decorators, which are a way of having one function “wrap” another function. Because the wrapper has access to both the input parameters and the return value, it can modify these values (unbeknownst to the inner function).

This time I pick up where I left off by exploring decorators modifying return values, decorators that take parameters, and decorators in classes.

Continue reading →

Python Decorators, part 1

24 Friday Apr 2020

Posted by Wyrd Smythe in CS101

≈ 1 Comment

Tags

Aspect-Oriented Programming, Python, Python code, Python decorator

I’ve been playing around with what Python calls decorators. They’re a built-in way of implementing Aspect-Oriented Programming techniques in Python. In fact, they’re quite powerful.

Since they aren’t a common language feature, they can be a little confusing at first, so I thought I’d try my hand at laying out how they work.

Continue reading →

Follow The Hard-Core Coder on WordPress.com

The Posts

  • Brian Kernighan: Successful Language Design
  • My Python App Framework
  • Multiplication Visualized
  • Square Root of 2
  • Life With Class
  • John Conway’s Life
  • Python Decorators, part 2
  • Python Decorators, part 1
  • Function Currying
  • Rule #5: Always Use Parentheses

The Topics

  • Blog (4)
  • CS101 (28)
  • Fun (22)
  • Interesting (1)
  • Opinion (12)
  • Stories (12)
  • Uncategorized (1)

The Month

January 2021
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Oct    

The Past

It’s me!

Wyrd Smythe

Wyrd Smythe

The canonical fool on the hill watching the sunset and the rotation of the planet and thinking what he imagines are large thoughts.

View Full Profile →

The Main Blog

Visit Logos con carne

Lots of wyrds... with meat!

Posts

RSS Feed

Comments

RSS Feed

Enter your email address to follow The Hard-Core Coder and get email when there is a new post.

Blog at WordPress.com.