Skip to content

Conversation

JoseALermaIII
Copy link
Owner

@JoseALermaIII JoseALermaIII commented Jul 28, 2019

Summary

Keep on truckin' through Chapter 4 with a letter substitution/transposition cipher identifier implemented using a decorator.

Description

Recently shown an interesting use of decorators, so I decided to tinker with them and see how they can be implemented by refactoring identify_cipher.py to use them.

As I mention in the docstrings, Luciano Ramalho's book Fluent Python appropriately calls decorators "syntactic sugar" when they aren't used in classes. The book also references the wrapt module's blog on GitHub for a deeper explanation of decorators.

The difference between import time and runtime is interesting.

If that wasn't enough, tests and docs included to really emphasize the over-engineering.

I know I said in #1 that a PR seems unnecessary and wasteful; however, I must emphasize that this is one of the most pointless things I have ever made.

Team Notifications

Me, myself, and I

@JoseALermaIII JoseALermaIII changed the title Add Identify cipher deco Add identify-cipher-deco Jul 28, 2019
@JoseALermaIII JoseALermaIII self-assigned this Jul 28, 2019
@JoseALermaIII JoseALermaIII added the invalid This doesn't seem right label Jul 28, 2019
@JoseALermaIII
Copy link
Owner Author

I am hesitant to call this an "enhancement" or "feature," but whatevs - it exists, so it's getting added.

@JoseALermaIII JoseALermaIII merged commit d303041 into master Jul 28, 2019
@JoseALermaIII JoseALermaIII deleted the identify-cipher-deco branch July 28, 2019 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant