Do they belong to you? Claim these comments.
Ben Finney
Is this you? Claim Profile »
2 weeks ago
in Python Exception Handling Techniques - Doug Hellmann on Doug Hellmann2 weeks ago
in Is this pylint error message valid or bogus? on t+1If you do that, you're communicating badly.
Python's default arguments mean something very specific, and readers will expect it: “this argument can be omitted, and if so, *this value will be used instead*”. By putting a value there that you never intend on using, you subvert that communication.
Please, if you don't have a good static value to use, just stick with the conventional sentinel value: None.
If you need None for some other purpose (e.g. you need to tell the difference between the default and a user-supplied None), use a clearly-for-no-other-purpose object, such as a module-local name bound to a unique object() instance.
3 weeks ago
in Don’t negotiate on your estimates on t+1The flip side of that, though, is that we need to be true to that by *revising* an estimate as requirements change, and more importantly as we get a better understanding of the facts that affect our estimate.
We also need to treat estimates more like forecasting: as testable predictions, that can be improved by examining the track record and learning how to estimate better. If we want the recipients of these estimates to trust us, we need to commit to improving our skill at estimating.
- 2 points
- Jump to »
3 weeks ago
in When to use globals on t+1There's nothing wrong with *module*-level globals, which is the largest scope in Python.
3 months ago
in Instead of setting instance attributes within __init__ on t+1Another problem is you've defined only a read-only property: the decorator wraps the getter, but the property has no setter (or deleter or docstring).
The above just looks like a mess!
9 months ago
in I just wrote another mock object framework. on t+1- 2 points
- Jump to »
I probably should have included a few example uses. Pretend I want to mock an object that has an attribute named ivr_sends which is a list of strings. I'd do this:
mm = BazMock(ivr_sends=['abc', 'def'])
Now my test code can access mm.ivr_sends just fine.
And now pretend you need to mock attributes on attributes:
mm = BazMock(x=BazMock(y=[BazMock(a=1, b=2), BazMock(a=3, b=4)]))
And now I can access mm.x.y[0].a.
For methods, you'd need to graft on definitions like this:
def fake_foo(x):
return "99"
mm.foo = fake_foo
I've been told that there are better mock objects out there, that do stuff like inspect a module or a class and create mocks automatically.
I'm dragging my feet about learning them. Let me know if you find one you like.
9 months ago
in Why Google won’t do evil on The Technology Liberation FrontOkay, so we agree that all Google now needs is motivation to do evil; or, phrased differently, lack of motivation to behave virtuously.
> But the relevant question isn’t whether Google could do evil, but whether it realistically will.
Since the information they gather is theirs forever — the users certainly have no practical control over it once it's granted to Google — that “will” becomes “will, ever, at any point in the future”.
> What incentive is there for Google to do anything but keep private data as secure as humanly possible?
Here you make the fallacy of assuming that Google's *current* model is sufficient guarantee that they will *forever* have incentive to be virtuous with the data we give them every day over time.
The correct question is: How likely is it that Google's model, leadership, or shareholder pressures, forever into the future, will always be sufficient to constrain Google to act virtuously with the data gathered on all parties that interact with them over their entire history?
And it's not even necessary for Google to care about behaving "virtuously." To do anything but safeguard privacy would be suicidal, even if Google's business model were to change down the line. Google can't change it privacy policies to the detriment of its users without their explicit permission.
There are privacy risks to using Google's services, as there are with using any company's services where that company will have possession of personal info. With respect to Google, I think these risks are fairly trivial, but different people have different levels of risk aversion. Fortunately, nobody has to use Google--you don't even have to give Google your IP address to use it search engine (A topic I will be discussing in greater detail soon).
11 months ago
in Google Search Won’t Return Links to cato-at-liberty.org on The Technology Liberation Front11 months ago
in Google Search Won’t Return Links to cato-at-liberty.org on The Technology Liberation Front=====
I was looking for Cato-at Liberty articles around the same time as a specific article by David Boaz, that I know contains the text "remains a temptation to our current candidates".
The Google result shows the article at David Boaz's own site, but *not* the same article at the URL http://www.cato-at-liberty.org/2008/06/30/our-c...
The cato-at-liberty site should be prominent in the results, as it is linked to by many other sites, and the very same article at a different site appears in the search results.
Specifying "site:cato-at-liberty.org" in the search criteria returns *no* results. The expected behaviour is that the site should have its results along with any others that qualify according to the criteria.
1 year ago
in Pep Turds on jessenoller.com commentsI usually include the following Emacs-and-Vim turd in my reStructuredText documents:
..
Local Variables:
mode: rst
coding: utf-8
End:
vim: filetype-rst :
In seriousness, I sort of dislike embedding editor-specific "nuggets of joy" into documents - I can see why you might do it, but still.
2 years ago
in Microsoft and Novell - Exacerbating an Ideological Divide? on The Technology Liberation FrontThe recent Samba team response is clear: the GPL is a zero-sum game -- you exploit open source software for your gain to the detriment of others
That's not how I read the Samba team response at all. In fact they're saying quite the contrary:
One of the fundamental differences between the proprietary software world and the free software world is that the proprietary software world divides users by forcing them to agree to coercive licensing agreements which restrict their rights to share with each other, whereas the free software world encourages users to unite and share the benefits of the software.
The patent agreement struck between Novell and Microsoft is a divisive agreement. It deals with users and creators of free software differently depending on their "commercial" versus "non-commercial" status, and deals with them differently depending on whether they obtained their free software directly from Novell or from someone else.
The GPL sets up a non-zero-sum game, by ensuring that a work can be shared freely by all recipients. Software idea patents attempt to revert to a zero-sum game, by dividing each recipient against the others.
2 years ago
in Samba Blasts Novell on The Technology Liberation FrontCrosbie: The GPL, at its heart, is about ensuring that *all* recipients of the software have the same guaranteed freedoms. Patent extortion payments for *some* of those recipients is divisive and makes the other recipients less free. That's why the GPL speaks explicitly about software patents, and in particular about ensuring patents can't be used against *any* recipient of the software. Novell's deal violates this in spirit; we have yet to see whether it violates it in law.
Noel: Making a payment for a software patent license is very similar to paying an extortion fee to a mob. The patent holder provides nothing of value, except a limited promise not to harm the one who makes the payment. The one who pays the fee gains nothing that they would have had in the absence of this extortion. The fact that someone pays the fee only serves to legitimise this extortion, and encourage the patent holder to attempt further extraction of fees from others.