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?
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! 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. On Wed, Jun 18, 2014 at 7:23 PM, Saimadhav Heblikar < saimadhavhebli...@gmail.com> wrote: > In this version, I have attempted an API like solution. It does not > raise any error.(except for couple of asserts for REALLY bad input, > and that too only in internal functions) > > All mistakes are caught(i.e. it does not fail on the first > "mistake".). I have documented every where, so should be easy to read. > Each aspect is a method. So is easy to unittest and has been > unittested. > > It can detect invalid begin character, invalid end character, repeated > keys, invalid keys, invalid ordering and with reason, where not > directly obvious. > > -- > Regards > Saimadhav Heblikar >
_______________________________________________ IDLE-dev mailing list IDLE-dev@python.org https://mail.python.org/mailman/listinfo/idle-dev