Dictionaries should have key-based set operations - Ideas
Jun 24, 2023 ... ... lists/sets, whereas difference / intersection does. ... Consider the utility of the following example in no-external-import Pure-Python code.
Jun 24, 2023 ... ... lists/sets, whereas difference / intersection does. ... Consider the utility of the following example in no-external-import Pure-Python code.
Why not use sets and the intersection operator (which is an operator, not a function, builtin or otherwise)?Alternatively, are you trying to find the intersection of two lists, without duplication of the items that occur in both lists? This does suggest that you intend to avoid duplication
While I understand that set.union and set.intersection are instance methods, I wonder what could possibly be the difficulties to making them convert a non-set self to a set first, when used as class methods.
github.com/python/typing.For example, you might want to state that an argument must be an Iterable and a Container (for example, it could be a Set, a Mapping or a Sequence).
GitHub - CarliJoy/intersection_examples: Python Typing Intersection examples.Powered by Discourse, best viewed with JavaScript enabled.