Skip to content

isalpha and isdigit do not work correctly with a subscripted input character #25543

@kenglander53

Description

@kenglander53

Type: Bug

Behaviour

isdigit and isalpha return True incorrectly

Steps to reproduce:

EXAMPLE CODE:

string = "dblcount 12"
items = string.split (" ")
element = items [0]
print (element [0])
if element [0].isalpha:
print ("isalpha is true")
else:
print ("isalpha is false")

if element [0].isdigit:
print ("isdigit is true")
else:
print ("isdigit is false")

element = items [1]
print (element [0])
if element [0].isalpha:
print ("isalpha is true")
else:
print ("isalpha is false")

if element [0].isdigit:
print ("isdigit is true")
else:
print ("isdigit is false")

OUTPUT:

d
isalpha is true
isdigit is true
1
isalpha is true
isdigit is true

Extension version: 2025.16.0
VS Code version: Code 1.105.1 (7d842fb85a0275a4a8e4d7e040d2625abbf7f084, 2025-10-14T22:33:36.618Z)
OS version: Windows_NT x64 10.0.26100
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.5
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
debugpy ms- 2025.14.1
js-debug ms- 1.105.0
js-debug-companion ms- 1.1.3
python ms- 2025.16.0
vscode-js-profile-table ms- 1.0.10
vscode-pylance ms- 2025.8.3
vscode-python-envs ms- 1.10.0
System Info
Item Value
CPUs Intel(R) Core(TM) 7 150U (12 x 2611)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.69GB (2.85GB free)
Process Argv --crash-reporter-id 8fe53d84-2b89-40ee-b241-4fd1371cb725
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vswsl492cf:30256860
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31334701
aj953862:31281341
nes-set-on:31340697
63221493:31336333
envsdeactivate2:31353495
gendocstringf:31405073
0574c672:31404437
cloudbuttont:31379625
todos-1:31405332
v66_all_req:31402695
multireplacestring:31398340
treatment_gpt5applypatchexclusively:31398171
3efgi100_wstrepl:31403338
trigger-command-fix:31379601
auto_model_enabled:31385282
grok-control-prompt:31401224
use-responses-api:31390855
applesignin:31399435
anonusage:31403420
2a0ce269:31405347

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions