Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
49bcd893
Unverified
Commit
49bcd893
authored
Aug 04, 2025
by
ZiTian.Zhao
Committed by
GitHub
Aug 03, 2025
Browse files
[refactor] improve ConstantList exception specificity (#22156)
Signed-off-by:
zitian.zhao
<
zitian.zhao@tencentmusic.com
>
parent
aa7012eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
vllm/v1/utils.py
vllm/v1/utils.py
+8
-8
No files found.
vllm/v1/utils.py
View file @
49bcd893
...
@@ -34,22 +34,22 @@ class ConstantList(Generic[T], Sequence):
...
@@ -34,22 +34,22 @@ class ConstantList(Generic[T], Sequence):
self
.
_x
=
x
self
.
_x
=
x
def
append
(
self
,
item
):
def
append
(
self
,
item
):
raise
Exception
(
"Cannot append to a constant list"
)
raise
TypeError
(
"Cannot append to a constant list"
)
def
extend
(
self
,
item
):
def
extend
(
self
,
item
):
raise
Exception
(
"Cannot extend a constant list"
)
raise
TypeError
(
"Cannot extend a constant list"
)
def
insert
(
self
,
item
):
def
insert
(
self
,
item
):
raise
Exception
(
"Cannot insert into a constant list"
)
raise
TypeError
(
"Cannot insert into a constant list"
)
def
pop
(
self
,
item
):
def
pop
(
self
,
item
):
raise
Exception
(
"Cannot pop from a constant list"
)
raise
TypeError
(
"Cannot pop from a constant list"
)
def
remove
(
self
,
item
):
def
remove
(
self
,
item
):
raise
Exception
(
"Cannot remove from a constant list"
)
raise
TypeError
(
"Cannot remove from a constant list"
)
def
clear
(
self
):
def
clear
(
self
):
raise
Exception
(
"Cannot clear a constant list"
)
raise
TypeError
(
"Cannot clear a constant list"
)
def
index
(
self
,
def
index
(
self
,
item
:
T
,
item
:
T
,
...
@@ -78,10 +78,10 @@ class ConstantList(Generic[T], Sequence):
...
@@ -78,10 +78,10 @@ class ConstantList(Generic[T], Sequence):
...
...
def
__setitem__
(
self
,
item
:
Union
[
int
,
slice
],
value
:
Union
[
T
,
list
[
T
]]):
def
__setitem__
(
self
,
item
:
Union
[
int
,
slice
],
value
:
Union
[
T
,
list
[
T
]]):
raise
Exception
(
"Cannot set item in a constant list"
)
raise
TypeError
(
"Cannot set item in a constant list"
)
def
__delitem__
(
self
,
item
):
def
__delitem__
(
self
,
item
):
raise
Exception
(
"Cannot delete item from a constant list"
)
raise
TypeError
(
"Cannot delete item from a constant list"
)
def
__iter__
(
self
):
def
__iter__
(
self
):
return
iter
(
self
.
_x
)
return
iter
(
self
.
_x
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment