[issue33219] x in IntFlag should test raise TypeError if x is not an IntFlag

2018-04-12 Thread Ethan Furman

Ethan Furman  added the comment:

This and issue33217 are similar enough I'm going to track it in issue33217.

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> x in enum.Flag member is True when x is not a Flag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33219] x in IntFlag should test raise TypeError if x is not an IntFlag

2018-04-05 Thread Ethan Furman

Ethan Furman  added the comment:

issue33217 is tracking member-containment checks; modifying this one to track 
class-containment checks.

Given

  class Color(Enum):
 RED = 1

  class Fruit(Enum):
 APPLE = 1

then

  --> Fruit.APPLE in Color
  False
  --> Fruit.APPLE in Fruit
  True
  --> 1 in Fruit
  TypeError

The last is currently returning False instead of raising a TypeError.

--
stage:  -> needs patch
title: x in IntFlag() should test int x's inclusion in IntFlag -> x in IntFlag 
should test raise TypeError if x is not an IntFlag
type: enhancement -> behavior
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com