Python Forum
Why interpreter accepts indentation made with spaces and not those by tabs
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why interpreter accepts indentation made with spaces and not those by tabs
#11
Quote:My way works very well.
until some unknowing user tries to read your code and doesn't know that his editor has been set up with 20 character tabs.
Reply
#12
On vim the default of the tab is 12, but you adjust with : :set softtabstop=4
Reply
#13
(Oct-18-2018, 06:12 PM)sylas Wrote: IMy way works very well.
Two threads on this non-issue are an ample proof Snooty
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply
#14
If you have a GUI environment, the Spyder3 IDE (https://github.com/spyder-ide/spyder) will catch mixes of spaces and tabs by flagging the first inconsistent line in every indented block. Also, the Source drop down from the menu has some very useful source file cleanup functions:
  • Convert EOL characters as you wish.
  • Remove trailing spaces.
  • Fix indentation.
  • Run a strict code analysis (take with a grain of salt, if you wish).
It's a very useful editor, executor, and debugger. I use it quite a bit.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  cmath.rect accepts a negative modulus JMB 2 305 Jan-17-2024, 08:00 PM
Last Post: JMB
  function accepts infinite parameters and returns a graph with those values edencthompson 0 812 Jun-10-2022, 03:42 PM
Last Post: edencthompson
  Buttons not working in tabs kenwatts275 2 1,336 May-02-2022, 04:45 PM
Last Post: kenwatts275
  PYQT charts in tabs frohr 10 4,228 Feb-13-2022, 04:31 PM
Last Post: Axel_Erfurt
  create new tabs and populate using python reggie4 2 2,218 Jan-23-2021, 11:25 PM
Last Post: Larz60+
  HELP TabError: inconsistent use of tabs and spaces in indentation blackjesus24 2 3,518 Jan-30-2020, 10:25 AM
Last Post: blackjesus24
  Setting Tabs in a listbox scratchmyhead 2 2,768 Nov-12-2019, 11:18 PM
Last Post: scratchmyhead
  removing spaces/tabs after used .strip() zarize 0 1,554 Sep-11-2019, 12:46 PM
Last Post: zarize
  removing tabs from input text jenya56 3 3,148 Mar-28-2019, 03:10 PM
Last Post: DeaD_EyE
  Writing a function that accepts a path to an input file says 3 3,222 Aug-29-2018, 05:20 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020