New submission from Marc Guetg <guetg.m...@gmail.com>:
It seems like sharing a string over processes is not possible.
#!/usr/bin/env python3
import multiprocessing
import threading
import ctypes
def fun(share_c, share_s,
Marc Guetg added the comment:
@ethan, didn't know about aenum, thanks for showing it to me. However it
doesn't seem to support the behavior I'm after (or I'm doing something wrong)
import aenum
try:
class Foo(aenum.Flag):
a = aenum.auto()
b
Marc Guetg added the comment:
One made-up use-case would be:
class LogLevel(Flags):
start = auto()
log1 = start | auto()
log2 = start | auto()
def fun(flags, *args):
if start in flags:
# open log file
if log1 in flags:
# Log important thing 1
if log2
Changes by Marc Guetg <guetg.m...@gmail.com>:
--
title: implement __or__ in enum.auto -> implementation of __or__ in enum.auto
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
New submission from Marc Guetg:
At the moment it is only possible to combine flags that already exist:
from enum import *
class Foo(Flag):
A = auto() # 1
B = auto() # 2
AB = A | B # 3 (1 | 2)
AC = auto() | A # Fails, but should be 5 (1 | 4)
ABD = auto
New submission from Marc Guetg:
I propose to change __ne__ of `object` in the following form:
class NewObject(object):
def __ne__(self, other):
return not self.__eq__(other)
Currently overwriting the `__eq__` method requires also overwriting