Steven showed a more abstract solution than the one I tried but Cameron is
making some good points on whether it might not be a great idea to chain
some side-effect operations.
I have seen languages where everything seems to be immutable. Python does
this in places like with tuples. The idea is th
On Tue, Dec 25, 2018 at 11:56:21PM -0500, Avi Gross wrote:
> I find that many people are fairly uncomfortable with abstraction and
> tend to resist a pure top down approach by diving to any solutions
> they may envision.
https://blog.codinghorror.com/it-came-from-planet-architecture/
> As some
[REAL SUBJECT: What's this?]
Steven,
I am afraid you are right. I was not selfish enough about this. I have done
object-oriented programming in many other languages and I am afraid today it
showed. Think C++ or Java. Part of me continues to think in every language I
ever used, including human lan
Mike,
Excellent advice.
I find that many people are fairly uncomfortable with abstraction and tend to
resist a pure top down approach by diving to any solutions they may envision.
For example, if you say things like create a data structure that can hold as
many kinds of information as will be
On Tue, Dec 25, 2018 at 10:25:50PM -0500, Avi Gross wrote:
> class chainable_list(list):
> """Same as list but sort() can now be chained"""
> def chainsort(this, *args, **kwargs):
> this.sort(*args, **kwargs)
> return this
In Python, it is traditional to use "self" rather
Alan,
Your thoughts were helpful and gave me a hint.
Just an idea. What if you sub-classed an object type like list with a name
like chainable_list?
For most things it would be left alone. But if you isolated specific named
methods like sort() and reverse() you could over-ride them with the same
On 26Dec2018 01:06, Alan Gauld wrote:
On 26/12/2018 00:00, Avi Gross wrote:
great. Many things in python can be made to fit and some need work.
Dumb example is that sorting something internally returns None and
not the object itself.
This is one of my few complaints about Python.
In Smalltal
On Wed, Dec 26, 2018 at 01:06:04AM +, Alan Gauld via Tutor wrote:
> In Smalltalk the default return value from
> any method is self. In Python it is None.
>
> self allows chaining of methods, None does not.
You might be interested in this simple recipe for retrofitting method
chaining onto
On 26/12/2018 00:00, Avi Gross wrote:
> great. Many things in python can be made to fit and some need work. Dumb
> example is that sorting something internally returns None and not the object
> itself.
This is one of my few complaints about Python.
In Smalltalk the default return value from
any
[Long enough that some should neither read nor comment on.]
Mats raised an issue that I think does relate to how to tutor people in
python.
The issue is learning how to take a PROBLEM to solve that looks massive and
find ways to look at it as a series of steps where each step can be easily
solved
On 12/24/18 5:45 PM, Avi Gross wrote:
> As for the UNIX tools, one nice thing about them was using them in a
> pipeline where each step made some modification and often that merely
> allowed the next step to modify that. The solution did not depend on one
> tool doing everything.
I know we're wo
11 matches
Mail list logo