Article 5VCSC CodeSOD: Convenience

CodeSOD: Convenience

by
Remy Porter
from The Daily WTF on (#5VCSC)

Casey works with some pretty courteous and forward thinking Python developers. They want to make sure that using their APIs are as convenient as possible, and make sure to provide all sorts of useful convenience methods. Like this one:

@propertydef request(self): """ just for convenience """ return self

For the non-Python folks, self is the Python equivalent of this in other languages, and it has to be passed as a parameter because Python is weird. So this method allows you to call request on an object to get the object you just called request on.

As Casey describes it: "That's pretty convenient!"

buildmaster-icon.png [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how! TheDailyWtf?d=yIl2AUoC8zA
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments