Skip to content

Commit d82b332

Browse files
kentwaittomchristie
authored andcommitted
Changes ternary conditionals to be PEP308 compliant (#5827)
1 parent 7d0d22f commit d82b332

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/tutorial/4-authentication-and-permissions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ And now we can add a `.save()` method to our model class:
3333
representation of the code snippet.
3434
"""
3535
lexer = get_lexer_by_name(self.language)
36-
linenos = self.linenos and 'table' or False
37-
options = self.title and {'title': self.title} or {}
36+
linenos = 'table' if self.linenos else False
37+
options = {'title': self.title} if self.title else {}
3838
formatter = HtmlFormatter(style=self.style, linenos=linenos,
3939
full=True, **options)
4040
self.highlighted = highlight(self.code, lexer, formatter)

rest_framework/routers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class SimpleRouter(BaseRouter):
148148
]
149149

150150
def __init__(self, trailing_slash=True):
151-
self.trailing_slash = trailing_slash and '/' or ''
151+
self.trailing_slash = '/' if trailing_slash else ''
152152
super(SimpleRouter, self).__init__()
153153

154154
def get_default_base_name(self, viewset):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy