Message265508
To explain in more detail: ``type('s').startswith`` is the same as ``str.startswith``, which is an unbound method in Python 2 and a regular function in Python 3. Either way, it expects *two* arguments: a string which becomes "self", and a second string argument, which is the prefix being tested for.
So type('any string').startswith('alphabet', 'al') is a long way of writing 'alphabet'.startswith('al'). |
|
Date |
User |
Action |
Args |
2016-05-14 07:44:39 | steven.daprano | set | recipients:
+ steven.daprano, paul.moore, tim.golden, SilentGhost, zach.ware, steve.dower, VertigoRay |
2016-05-14 07:44:39 | steven.daprano | set | messageid: <1463211879.81.0.478045408463.issue27017@psf.upfronthosting.co.za> |
2016-05-14 07:44:39 | steven.daprano | link | issue27017 messages |
2016-05-14 07:44:39 | steven.daprano | create | |
|