cat /dev/brain

Articles in the Python category

Distributing Python Libraries with Type Annotations

Back in December, when I released rush, I struggled to figure out the appropriate way to signal that the library was shipping with type annotations built-in. I've also been working on adding type annotation stub files to github3.py as a result, I've had to look around quite a bit …

Posted on 03 February 2019 by Ian Stapleton Cordasco

Requests 1.2.0

tl;dr dispatch_hook now sends the keyword arguments that were originally sent with the request. Hook authors should modify their hooks to accept them and resend them.

This morning Kenneth published (on PyPI and Crate) requests 1.2.0 which included a lot of very important changes. One, which will …

Posted on 31 March 2013 by Ian Cordasco

Weirdness in python2

So a friend of mine is learning python and was fooling around in the interactive console. They accidentally ran:

'str' > 19
# But they meant to run
'str' > '19'

Can you guess what that evaluated to? Conventional thought would suggest a TypeError, but in fact that evaluates to True. Odd right …

Posted on 22 August 2012 by Ian Cordasco

github3.py (update)

I previously mentioned my work on github3.py and how I was having trouble creating downloads on GitHub because they use Amazon's S3 service for the uploaded files. What this means is that first you have to "create" the download on GitHub then you have to upload the actual file …

Posted on 02 August 2012 by Ian Cordasco

Python: del

While testing github3.py by hand, I found myself wanted to delete objects that I created as a test from an array after deleting them on GitHub. To do that, I have to do:

gists[index].delete()
del gists[index]

So my initial instinct was to modify the __del__ method …

Posted on 26 June 2012 by Ian Cordasco

github3.py

After finishing finals, I started working on my project to wrap the Github API. Recently, I came across the area of the API dealing with creating a download on a repository. The one thing that has made this project so enjoyable has been requests. Upon reaching this section, I noticed …

Posted on 17 June 2012 by Ian Cordasco

Sprunge.us

The Context

I use sprunge.us on the rare occasion that I need to paste something for someone else to see. It's simple to use, written in python and open source. The chief example when you visit the website uses curl (and I love using the command line for as …

Posted on 09 June 2012 by Ian Stapleton Cordasco