spacepaste
new
Paste details
reply
|
raw
from
typing
import
List
# No error:
class
A
:
a
:
List
[
str
]
=
[]
def
append
(
self
):
self
.
a
.
append
(
3
)
a
=
A
()
a
.
append
()
print
(
a
.
a
)
# Error:
b
:
List
[
str
]
=
[]
b
.
append
(
3
)
print
(
b
)