Modernize Code In IDLELib Editor Backspace
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
(and potentially deprecate handling of tabs in IDLE, though likely separate issue)
In https://github.com/python/cpython/issues/136061, https://github.com/python/cpython/blob/561212a03306cb2f246771e9c4748bec1dc41405/Lib/idlelib/editor.py#L1365-L1385 is mentioned as an area of code with quadratic complexity, which may lead to performance issues; though this is unlikely to be of large impact in practice because attackers with the ability to get a huge file loaded and/or modify configuration files to change the tab width can do much worse things than getting IDLE to hang on hitting backspace.
However, the complexity there comes from a loop which handles situations (files with tabs) that either cannot or should not occur; in the current default IDLE, you can't put tabs, and a space after a tab should just be deleted in a file coming from elsewhere as in indicated in https://github.com/python/cpython/pull/134874#issuecomment-3014981765. Therefore, simplifying the function specification and/or deprecating IDLE to handle tabs (which we should do) will allow elimination of this piece of obsolete code, as indicated in https://github.com/python/cpython/issues/136061#issuecomment-3016093746.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Leggi prima le righe 1365–1385 di Lib/idlelib/editor.py, poi esamina issue 136061 e la discussione collegata in PR 134874. Chiarisci se questo issue comprende la semplificazione della gestione di Backspace, la deprecazione della gestione di Tab o entrambe; è completato quando l'ambito concordato è implementato e il comportamento obsoleto è stato gestito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- desktop, tooling
- Tipo di issue
- Refactoring
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100