Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102101 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2016-01-26 04:36 +1100 |
| Last post | 2016-01-26 04:36 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Re[2]: .format won't display my value with 2 decimal places: Why? Chris Angelico <rosuav@gmail.com> - 2016-01-26 04:36 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2016-01-26 04:36 +1100 |
| Subject | Re: Re[2]: .format won't display my value with 2 decimal places: Why? |
| Message-ID | <mailman.226.1453743419.15297.python-list@python.org> |
On Tue, Jan 26, 2016 at 4:31 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
>> Do you really want to insist that the format string always used _all_ of the
>> arguments?
>
> Good point, that makes sense. For example, I would expect this to work:
>
> '{0} {2}'.format(*some_list)
>
> as long as some_list has three elements. I wouldn't expect it to fail
> just because the middle element is unused, so why should it fail if
> there are trailing elements that are unused?
That's using selectors, so under my suggested semantics, that would
still work - as long as it has *at least* three elements, the middle
one and any extras after the third are all ignored.
ChrisA
Back to top | Article view | comp.lang.python
csiph-web