what does := means simply?

Richard Damon Richard at Damon-Family.org
Sun May 20 16:36:12 EDT 2018


On 5/20/18 11:52 AM, Dennis Lee Bieber wrote:
> On Sun, 20 May 2018 12:11:34 +0100, bartc <bc at freeuk.com> declaimed the
> following:
>
>> I think that's the wrong approach. You need to work to the lowest common 
>> denominator, not the highest. (Within reason anyway.)
>>
> 	If a reader can not handle permitted variations documented in a
> specification, then that reader is erroneous, and bug report should be
> filed for it.
>
>> If you tested half a dozen viewers, and two of them don't need any 
>> newlines between groups, and the rest need at least one, or between all 
>> groups, what does this tell you about how you should be generating your 
>> file?
>>
> 	Nothing about how /I/ should generate the file -- it tells me those
> readers are non-conformant with the specification.
>
> 	The specification document drives the requirements for reading and
> writing, the requirements drive the implementation. If a program does not
> implement the requirements derived from the specification, that program is
> incomplete and/or in error.
>
> 	That most implementations are using a <newline> convention when
> /writing/ a PPM file does not negate the fact that the specification
> permits for no <newlines> at all (barring the need for one at the end of a
> comment), and a conformant /reader/ program shall accept those variations.
>
>
There are 3 basic ways to write something to a spec like this.

1) Write exactly to the specification, choosing options for generation
based on what is the easiest for you, and if other tools can't read
this, insist on writing bug reports.

2) Try to maximize portability by not only looking at the specs, but
also common implementations, and choosing the options that maximize the
acceptability of your output to tools that don't fully meet the specs.
Also, if a common implementation generates something not quite to the
standard, try to make it so you can accept that output too.

3) Decide to be a perverse implementation and choose strange ((or
random) combinations for generation choices to come up with files to
stress test other implementations, and be totally picky about the input
format, reporting the slightest deviation from the spec.


The second option is the best to choose if you really want to make your
application as useful as possible (except as a stress test).

-- 
Richard Damon




More information about the Python-list mailing list