Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #108577

Re: Design: Idiom for classes and methods that are customizable by the user?

From Dirk Bächle <tshortik@gmx.de>
Newsgroups comp.lang.python
Subject Re: Design: Idiom for classes and methods that are customizable by the user?
Date 2016-05-13 00:42 +0200
Message-ID <mailman.622.1463115954.32212.python-list@python.org> (permalink)
References <5734ECDF.7070006@gmx.de> <mailman.617.1463087060.32212.python-list@python.org> <87futnaqb2.fsf@elektro.pacujo.net> <573506C9.3070206@gmx.de>

Show all headers | View raw


Hi Marko,

thank you very much for your quick reply.

On 13.05.2016 00:01, Marko Rauhamaa wrote:
>>
>> [...]
>>
>> - Is this a good approach
>
> As an approach, that looks ok. The code looks a bit too lenient, though,
> which can easily surprise and baffle the user. I think it would be
> better to fail:
>
> ========================================================================
> class AlreadyExistsError(Exception):
>     pass
>
> [...]
>

Sure, I'll have exceptions in mind for the final implementation.

>
> [...]
>
> For example, why do you need a key? Couldn't you simply pass the task
> master class as an argument?
>

The idea behind this is, to be able to select classes by giving a parameter on the command-line. So at some point a translation from 
a given "key" to its actual class has to happen, I guess.

Regards,

Dirk

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Design: Idiom for classes and methods that are customizable by the user? Dirk Bächle <tshortik@gmx.de> - 2016-05-12 22:51 +0200
  Re: Design: Idiom for classes and methods that are customizable by the user? Marko Rauhamaa <marko@pacujo.net> - 2016-05-13 01:01 +0300
    Re: Design: Idiom for classes and methods that are customizable by the user? Dirk Bächle <tshortik@gmx.de> - 2016-05-13 00:42 +0200
      Re: Design: Idiom for classes and methods that are customizable by the user? Marko Rauhamaa <marko@pacujo.net> - 2016-05-13 08:53 +0300
  Re: Design: Idiom for classes and methods that are customizable by the   user? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-05-13 18:35 +1200
    Re: Design: Idiom for classes and methods that are customizable by the user? Michael Selik <michael.selik@gmail.com> - 2016-05-13 20:33 +0000
    Re: Design: Idiom for classes and methods that are customizable by the user? Dirk Bächle <tshortik@gmx.de> - 2016-05-17 16:51 +0200
    Re: Design: Idiom for classes and methods that are customizable by the user? Michael Selik <michael.selik@gmail.com> - 2016-05-17 18:13 +0000

csiph-web