How should I format the following code as per the PEP-8 guidelines? I don't see examples for something like this. Or is there no guideline for this? Most questions on SO ask about splitting long conditionals or line continuation.
def send_notification(version, device_type):
reg_ids = UDR.objects.filter(device_type=device_type).values_list('id', 'device_type', 'registration_id')
if not reg_ids:
logger.debug("No notifications to send")
Should it be formatted as:
def send_notification(version, device_type):
reg_ids = UDR.objects.filter(
device_type=device_type).values_list('id',
'device_type', 'registration_id')
if not reg_ids:
logger.debug("No notifications to send")
Or as this:
def send_notification(version, device_type):
reg_ids = UDR.objects.filter(device_type=device_type)\
.values_list('id',
'device_type',
'registration_id')
if not reg_ids:
logger.debug("No notifications to send")
Or something else altogether?