Skip to content

fix: Use is not None instead of != None for None checks. #5687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/sglang/bench_serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ async def limited_request_func(request_func_input, pbar):

# Use the first request for all warmup iterations
test_prompt, test_prompt_len, test_output_len = input_requests[0]
if lora_names != None and len(lora_names) != 0:
if lora_names is not None and len(lora_names) != 0:
lora_name = lora_names[0]
else:
lora_name = None
Expand Down Expand Up @@ -1060,7 +1060,7 @@ async def limited_request_func(request_func_input, pbar):
tasks: List[asyncio.Task] = []
async for request in get_request(input_requests, request_rate):
prompt, prompt_len, output_len = request
if lora_names != None and len(lora_names) != 0:
if lora_names is not None and len(lora_names) != 0:
idx = random.randint(0, len(lora_names) - 1)
lora_name = lora_names[idx]
else:
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/code_completion_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def completion_template_exists(template_name: str) -> bool:

def is_completion_template_defined() -> bool:
global completion_template_name
return completion_template_name != None
return completion_template_name is not None


def generate_completion_prompt_from_request(request: ChatCompletionRequest) -> str:
Expand Down
Loading