Nick Coghlan wrote:
anton muhin wrote:
anton muhin wrote:
Correction:
Of course, I can imagine some metaclasses magic that would allow to
code:
class MyClass(WithOverloading):
@overloadMethod(A)
def someMetod(self, _): ...
But it would rather convoluted: the best idea I have so far is to
Xah Lee wrote:
here's another interesting algorithmic exercise, again from part of a
larger program in the previous series.
Here's the original Perl documentation:
=pod
merge($pairings) takes a list of pairs, each pair indicates the
sameness
of the two indexes. Returns a partitioned list of same in
anton muhin wrote:
Correction:
Of course, I can imagine some metaclasses magic that would allow to code:
class MyClass(WithOverloading):
@overloadMethod(A)
def someMetod(self, _): ...
But it would rather convoluted: the best idea I have so far is to mangle
methods name in the manner most of
Dear pythonistas!
I'd like to emulate overloading in Python (like C++).
Let's consider an example:
class A(object): pass
class B(object): pass
Of course, there are some standard overloading implementations for
Python. For example:
def overload(cls):
def wrapper(f):
gl = f.func_globals
n
Stefan Behnel wrote:
shark schrieb:
row = {"fname" : "Frank", "lname" : "Jones", "city" : "Hoboken",
"state" :
"Alaska"}
cols = ("city", "state")
Is there a best-practices way to ask for an object containing only the
keys
named in cols out of row? In other words, to get this:
{"city" : "Hoboken