nonlocal fails ?

Chris Angelico rosuav at gmail.com
Fri Nov 15 07:00:26 EST 2019


On Fri, Nov 15, 2019 at 9:16 PM R.Wieser <address at not.available> wrote:
>
> Chris,
>
> > That doesn't really answer the question.
>
> The problem is that you want to solve /this/ problem, while I'm looking for
> replies that are applicable to similar ones too.
>
> To be blunt about it: I consider solutions that only solve a single problem
> most always as a waste of my time (exceptions to the rule, yadayadayada).
> Solutions that I can expand and build upon are the ones I'm looking for
> (read: learn from).
>
> But as lot of people will respond like you and than pick something from the
> /supporting information/ and go off on a tangent with it that doesn't aim to
> answer /my/ question I have become rather carefull about what I post in
> regard to specifics.
>
> > The point of your new car isn't to push the pedal - it's to get you some
> > place.
>
> And thats your problem in a nutshell: You think in forms of "get you some
> place".
>
> What about just /learning how to drive/ ?
>

The purpose of a car is not to learn how to ride a bicycle. Yes, I am
thinking in terms of an ultimate goal, because the point of coding is
to achieve something. Maybe your goal *right now* is to learn rather
than to create, but surely the purpose of the learning is to be able
to achieve things later?

Rather than try to implement pass-by-reference semantics in Python,
figure out what abstract concept you're actually trying to implement.
Otherwise, all you'll do is come up with convoluted methods of
implementing some other language's semantics in Python, and then write
your code using that other language's idioms, and run it in a Python
interpreter. Far better to actually learn Python's semantics, and how
they can be used to represent your actual goals.

ChrisA


More information about the Python-list mailing list