Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Style of bitwise operators in Python

Tags:

python

pep

I can't find in PEPs information about style of bitwise operators (|, &), in this code in particular:

class MySplashScreen(wx.SplashScreen):
    def __init__(self, parent=None):
        wx.SplashScreen.__init__(self, logo.getBitmap(), wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, 2000, parent)

Should I use spaces in this case (wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT)?

like image 572
art.zhitnik Avatar asked May 06 '26 19:05

art.zhitnik


1 Answers

I would definitely use spaces on either side. Otherwise, it'd hard to spot the | in between the variable/constant names.

like image 83
alex Avatar answered May 08 '26 08:05

alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!