re.search when used within an if/else fails

Prasad, Ramit ramit.prasad at jpmorgan.com
Thu Nov 29 17:57:00 EST 2012


Ramit Prasad wrote:
> 
> Dennis Lee Bieber wrote:
> >
> > 	Unless there has been a major change in the parser... (I still don't
> > have Python 3.x installed)
> >
> > 	I believe <tab> is expanded to 8-spaces -- NOT TO NEXT MULTIPLE OF
> > 8...
> 
> A tab is *one* character. Your *editor* may show tabs visually
> "expanded" or convert them to spaces. This is entirely editor dependent.
> My current (python) editor, does expands tabs to the next *multiple* of 4.
> It helps keep code aligned, and I have no need for 4 hard spaced tabs
> without regards to alignment (yet). I have had editors that did 4 hard
> spaced tabs, so it might be a developer/application preference.
> 
> >>> with open(r'c:\ramit\mix_tab_space.txt')as f:
> ...     d = f.read()
> ...
> >>> print repr(d)
> '\tblah\n    test\n\t'
> >>> print d[0] + 'goo'
> 	goo
> >>> print repr(d[0] + 'goo')
> '\tgoo'

Apologies, I missed that it was talking about the parser
and not editor/file. Please disregard my previous post. 


~Ramit


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  



More information about the Python-list mailing list