@@ -3499,7 +3499,7 @@ def xackdel(
3499
3499
if not ids :
3500
3500
raise DataError ("XACKDEL requires at least one message ID" )
3501
3501
3502
- if ref_policy not in ( "KEEPREF" , "DELREF" , "ACKED" ) :
3502
+ if ref_policy not in { "KEEPREF" , "DELREF" , "ACKED" } :
3503
3503
raise DataError ("XACKDEL ref_policy must be one of: KEEPREF, DELREF, ACKED" )
3504
3504
3505
3505
pieces = [name , groupname , ref_policy , "IDS" , len (ids )]
@@ -3541,11 +3541,9 @@ def xadd(
3541
3541
if maxlen is not None and minid is not None :
3542
3542
raise DataError ("Only one of ```maxlen``` or ```minid``` may be specified" )
3543
3543
3544
- if ref_policy is not None and ref_policy not in ( "KEEPREF" , "DELREF" , "ACKED" ) :
3544
+ if ref_policy is not None and ref_policy not in { "KEEPREF" , "DELREF" , "ACKED" } :
3545
3545
raise DataError ("XADD ref_policy must be one of: KEEPREF, DELREF, ACKED" )
3546
3546
3547
- if nomkstream :
3548
- pieces .append (b"NOMKSTREAM" )
3549
3547
if maxlen is not None :
3550
3548
if not isinstance (maxlen , int ) or maxlen < 0 :
3551
3549
raise DataError ("XADD maxlen must be non-negative integer" )
@@ -3560,6 +3558,8 @@ def xadd(
3560
3558
pieces .append (minid )
3561
3559
if limit is not None :
3562
3560
pieces .extend ([b"LIMIT" , limit ])
3561
+ if nomkstream :
3562
+ pieces .append (b"NOMKSTREAM" )
3563
3563
if ref_policy is not None :
3564
3564
pieces .append (ref_policy )
3565
3565
pieces .append (id )
@@ -3728,7 +3728,7 @@ def xdelex(
3728
3728
if not ids :
3729
3729
raise DataError ("XDELEX requires at least one message ID" )
3730
3730
3731
- if ref_policy not in ( "KEEPREF" , "DELREF" , "ACKED" ) :
3731
+ if ref_policy not in { "KEEPREF" , "DELREF" , "ACKED" } :
3732
3732
raise DataError ("XDELEX ref_policy must be one of: KEEPREF, DELREF, ACKED" )
3733
3733
3734
3734
pieces = [name , ref_policy , "IDS" , len (ids )]
@@ -4111,7 +4111,7 @@ def xtrim(
4111
4111
if maxlen is None and minid is None :
4112
4112
raise DataError ("One of ``maxlen`` or ``minid`` must be specified" )
4113
4113
4114
- if ref_policy is not None and ref_policy not in ( "KEEPREF" , "DELREF" , "ACKED" ) :
4114
+ if ref_policy is not None and ref_policy not in { "KEEPREF" , "DELREF" , "ACKED" } :
4115
4115
raise DataError ("XTRIM ref_policy must be one of: KEEPREF, DELREF, ACKED" )
4116
4116
4117
4117
if maxlen is not None :
0 commit comments