[Idle-dev] KeyConfig, KeyBinding and other related issues.

Saimadhav Heblikar saimadhavheblikar at gmail.com
Thu Jun 19 09:24:01 CEST 2014


On 18 June 2014 23:03, Tal Einat <taleinat at gmail.com> wrote:
> I see you went with an entirely different design for this than either what
> you originally suggested or what I suggested. Could you explain why?
>

I dont think I have gone with a different design. I have incorporated
what you suggested and what I had suggested, but put every aspect into
a method of its own. I felt it was best not to raise errors when there
was one, because I remember Terry Reedy and you mentioning that it
will be used in more than one place. I felt it would be better to
leave it to the user(the different places in Idlelib where it will be
used) to decide what to do in case there are mistakes.

> Technical notes:
>
> 1) _get_type() should be a class method instead of a normal method (using
> the @classmethod decorator). This will also make testing it simpler.
> 2) Never use "is" to compare strings!

I did not know these two things. Thanks for pointing them out.

> 3) Why not use Counter when generated the list of duplicate keys, as I
> suggested in my code sample? It's more straightforward and elegant.
> 4) I prefer to call the parts something other than "keys", perhaps "parts"
> or "pieces". In some cases, such as mouse events, they are not keyboard
> keys.
>
Will do 3 and 4.

Do we proceed with this?(incorporating the changes from Technical Notes)


-- 
Regards
Saimadhav Heblikar


More information about the IDLE-dev mailing list