recentpopularlog in

kme : slides   119

« earlier  
ModulePackage - ModulePackage.pdf
Video: https://www.youtube.com/watch?v=0oTh1CXRaQ0
Workshop materials: http://dabeaz.com/modulepackage/
# spam/__init__.py
__all__ = []
def export(defn):
globals()[defn.__name__] = defn
__all__.append(defn.__name__)
return defn
from . import foo
from . import bar
Makes the Python version explicit
% python3 -m pip install package

vs

% pip install package

Rant: I can't count the number of times I've had
to debug someone's Python installation because
they're running some kind of "script", but they
have no idea what Python it's actually attached to.
The -m option avoids this.

Neat `-m` tricks:

% python3 -m zipfile -c spam.zip spam/*.py
% rm -rf spam
% ls
spam.zip
% python3 spam.zip

See also: https://www.python.org/dev/peps/pep-0441/
python  packages  modules  slides  howto  newbie  reference  bestpractices 
december 2016 by kme
Twelve Views of Mark Jason Dominus
I released the Text::Template module several years ago, and it was immediately very successful. It's small, simple, fast, and it does a lot of things well. At the time, there were not yet 29 templating systems available on CPAN.

Anyway, the module quickly stabilized. I would get bug reports, and they would turn out to be bugs in the module's users, not in the module; I would get feature requests, and usually it turned out that what the requester wanted was possible, or even easy, without any changes to the module. Since the module was perfect, there was no need to upload new versions of it to CPAN.

But then I started to get disturbing emails. ``Hi, I notice you have not updated Text::Template for nine months. Are you still maintaining it?'' ``Hi, I notice you seem to have stopped work on Text::Template. Have you decided to abandon this approach?'' ``Hi, I was thinking of using Text::Template, but I saw it wasn't being maintained any more, so I decided to use Junk::CrappyTemplate, because I need wanted to be sure of getting support for it.''

I started wondering if maybe the thing to do was to release a new version of Text::Template every month, with no changes, but with an incremented version number. Of course, that's ridiculous. But it seems that people assume that if you don't update the module every month, it must be dead. People seem to think that all software requires new features or frequent bug fixes. Apparently, the idea of software that doesn't get updated because it's finished is inconceivable.

I blame Microsoft.

I'm not sure what to do about this. Larry said that the problem was Perl's poor object model. I disagreed. A better model will help solve the hash key collision problem, but not the undocumented method problem. I suggested that perhaps one solution would be for modules to start including an explicit SUBCLASSING INTERFACE section in their documentation, spelling out just what guarantees the author would make for subclasses.
perl  lisp  programming  slides  versioning  subclassing  npcomplete 
october 2015 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read