HN user

jknupp

1,115 karma

email: <my-user-name>@gmail.com

[ my public key: https://keybase.io/jeffknupp; my proof: https://keybase.io/jeffknupp/sigs/7Io3CXiZL-UByymj5V_cg4qQ1ZE5OalCTIpHKIhf1oU ]

Posts65
Comments109
View on HN
jeffknupp.com 10y ago

Python: `with` Context Managers

jknupp
1pts0
jeffknupp.com 11y ago

How Do You Rewrite a Project From Scratch Once It's On GitHub?

jknupp
4pts0
jeffknupp.com 12y ago

Omega: The Last Python Web Framework

jknupp
1pts0
jeffknupp.com 12y ago

Writing Idiomatic Python Ebook

jknupp
3pts0
jeffknupp.com 12y ago

Docker Blurs the Line Between SaaS and Self-Hosted Apps

jknupp
3pts0
jeffknupp.com 12y ago

Docker is the Most Disruptive Technology in the Last Decade

jknupp
4pts0
jeffknupp.com 12y ago

Python Classes and Object Oriented Programming

jknupp
1pts0
jeffknupp.com 12y ago

REST APIs, ORMs, And The Neglected Client

jknupp
1pts0
jeffknupp.com 12y ago

In Support of Female Engineers

jknupp
1pts0
jeffknupp.com 12y ago

How 'DevOps' Is Killing The Developer

jknupp
318pts209
jeffknupp.com 12y ago

Great Products Seem Obvious in Retrospect

jknupp
2pts0
jeffknupp.com 12y ago

Why I'm Boycotting Mozilla Products

jknupp
13pts28
www.kickstarter.com 12y ago

Writing Idiomatic Python: The Video Series

jknupp
1pts0
jeffknupp.com 12y ago

A Web Hosting Service That Teaches You How To Host Your Web App

jknupp
2pts0
www.jeffknupp.com 12y ago

Contribute to an OSS Python app for reviewing OSS Python apps

jknupp
1pts0
www.jeffknupp.com 12y ago

A Celery-like Python Task Queue in 55 Lines of Code

jknupp
60pts44
www.jeffknupp.com 12y ago

Starting a Python Project the Right Way

jknupp
6pts0
www.jeffknupp.com 12y ago

Productionizing A Flask Application

jknupp
2pts0
www.jeffknupp.com 12y ago

Need a Project Idea? Scratch Your Own Itch

jknupp
3pts0
www.jeffknupp.com 12y ago

I Wrote a Digital Goods Payment Solution in 2 Hours Last Night

jknupp
1pts0
www.jeffknupp.com 12y ago

How to Become "Internet Famous"

jknupp
1pts0
blog.sandman.io 12y ago

Great Products Are Obvious, In Retrospect

jknupp
6pts0
www.sandman.io 12y ago

Your Database Just Got Its Own Website

jknupp
4pts2
www.jeffknupp.com 12y ago

Your Database Just Got Its Own Website

jknupp
6pts1
www.jeffknupp.com 12y ago

Improve Your Python: Understanding Decorators

jknupp
3pts0
www.jeffknupp.com 13y ago

"Python's Hardest Problem," Revisited

jknupp
2pts0
www.jeffknupp.com 13y ago

Drastically Improve Your Python: Understanding Python's Execution Model

jknupp
12pts0
www.jeffknupp.com 13y ago

Anatomy of an eBook Launch: Raw Numbers

jknupp
1pts0
news.ycombinator.com 13y ago

Show HN: I wrote a book on idiomatic Python. Here's its insane build/test system

jknupp
15pts2
www.jeffknupp.com 13y ago

Is Python call-by-value or call-by-reference? Neither.

jknupp
39pts65

A shorter, more comprehensible version:

import requests

from bs4 import BeautifulSoup

from urlparse import urljoin

URL = 'http://philadelphia.craigslist.org/search/sss?sort=date&quer...

BASE = 'http://philadelphia.craigslist.org/cpg/'

response = requests.get(URL)

soup = BeautifulSoup(response.content)

for listing in soup.find_all('p',{'class':'row'}):

    if listing.find('span',{'class':'price'}):

        price = int(listing.text[2:6])

        if 100 < price <=250:

            print listing.text

            print urljoin(BASE, listing.a['href']) + '\n'

Notice I never said "He should never be allowed to state his opinion." He's free to do so, and did. And in doing so made a public statement about his views. If you believe basic human rights should be denied to a group of individuals, I have an issue with that.

I agree. I'm not being consistent in my views. I'm going to continue to use JavaScript, but I don't the Eich should be running Mozilla. Humans are complicated.

The goal was not to convince anyone that they needed to use a web framework. Rather, I hoped to explain to novices exactly what a web framework is and what problems it solves.

For someone who created their account 26 days ago, there's probably a lot you don't know... If enough people didn't find it interesting, it wouldn't be here.

I disagree. I would still have to wait for the API to return before I can proceed with the transaction and display the download page, so doing it synchronously makes more sense. And the overhead introducing Celery or python-rq would add versus the response time difference doing asynchronous email (which I'm using GMail for anyway, so I'm not too worried about it going down) makes the synchronous approach even more attractive.

Sorry, the terminology is confusing. What I replaced are the digital goods checkout services (that use processors like Stripe in the backend). They help you manage and sell digital goods, by, for example, generating a unique token for each purchase so that every customer has a different download URL. Clearly, as seen here, they don't add much value.

I could not agree more. Stripe = insanely awesome payment processor. With all the heavy lifting they do,

I'm now unsure what something like Gumroad's value proposition is, considering I'm basically at feature parity with them (aside from PDF stamping, which I don't do anyway).

The contact pages are now fixed. I'll be adding a link to instructions for download/trial of sandman. For now, you can use the Python installer, "pip", to install it via: "pip install sandman"

Contributions are always welcome. I've been making reasonably quick progress on it and it's getting more robust by the day. Already added features include a Django-style admin interface, user-defined HTTP methods per Model, and user-defined, per-method validation.

The two main features needed to make sandman really usable are authentication and the generation of "rel" links automatically from foreign key information. I'm working on authentication as we speak...

The point is, with Django you'd have to painstakingly reverse-engineer a Django Model from your existing database. sandman does all of this without writing any boilerplate code (aside from listing the names of the tables you want included in your API).

The difference in LOC and general frustration is huge.

I'm the original author (and didn't post this) but I fail to see how the article is FUD. In fact, the article makes the exact same point as your fourth paragraph ("Novices would..."). Controlling access to shared data often does lead to issues for many programmers, and just throwing threading at a problem is rarely a good idea.

I'm sorry you didn't find the article useful, but perhaps you're not in the article's target audience. I simply wanted to give Python novices some information and background about the GIL.

That said, the fact that other implementations do not have a GIL isn't relevant to the article; it specifically refers to the cPython implementation. And your observation that multiprocessing avoids the GIL is explicitly mentioned in the article. To say "blocking on I/O gives up the GIL" is true in a very narrow sense but not very interesting. Import any third party package using C extensions and you now need to worry about how well the author manages the GIL.

Author here.

Actually, the reason it hasn't been "solved" yet has much more to do with the cPython implementation rather than the fact that we can just use multiprocessing. There is a ton of globally shared data in the cPython implementation. Retrofitting a locking scheme granular enough to obviate the need for the GIL while at the same time not negatively impacting single-threaded performance is decidedly non-trivial.

The PyPy guys are making decent progress by attacking the problem from another angle: using software transactional memory to automatically resolve data conflicts that arise from multiple threads mutating data simultaneously.

Call by value would mean that a copy of the value of the argument is passed to the function without involving the original value at all. To say the binding is passed by value is not useful, as all languages would then be considered "call by value", since _something_ needs to be passed into the function, and we can just call it a value.