[Python-ideas] .from and .to instead of .encode and .decode

anatoly techtonik techtonik at gmail.com
Wed Mar 18 06:54:51 CET 2015


On Tue, Mar 17, 2015 at 7:10 PM, Luciano Ramalho <luciano at ramalho.org> wrote:
> On Mon, Mar 16, 2015 at 10:09 AM, anatoly techtonik <techtonik at gmail.com> wrote:
>> I use the analogy of "encoding abstract numbers into specific bytes" myself.
>
> Your version of the analogy doesn't sound as helpful to me; "abastract
> numbers" sounds even more cryptic than bytes.
>
> My mnemonics are "decode from cryptic bytes to human text" and "encode
> from human text to cryptic bytes".

Maybe I am thinking too low level, but there is no such thing as "human text" in
computer memory. But I agree that using the words like "abstraction" is not a
good idea, because Python is used by children of age 7, and things should be
simpler.

> A more objective problem is: "from" is a keyword, so it can't be a method name.

I don't see why "from" can not be used as a method name in Python. It can not
be used as function name, because it will override the keyword, but method
names are always namespaced with self. or class prefixes.

-- 
anatoly t.


More information about the Python-ideas mailing list