[Doc-SIG] Re: [Types-sig] Re: documenting Python constraints on types

Jeremy Hylton jeremy@digicool.com
Fri, 1 Jun 2001 16:01:54 -0400 (EDT)


>>>>> "FG" == Frederic Giacometti <frederic.giacometti@arakne.com> writes:

  FG> "Fred L. Drake, Jr." wrote:
  >> I don't think that's quite it, though it certainly has an affect
  >> on the interest in documenting the types.  Part of the lack of
  >> type information is a matter of there not being a shared set of
  >> names for abstract types that is also sufficient to be precise.
  >> (For example: What does it mean for an object to be a "mapping"?
  >> Perhaps has_key() is sufficient in one context, but get() and
  >> setdefault() are needed in another.)

  FG> A 'mapping' is an object that 'implements' the object protocol
  FG> (PyMapping_Check()... ok).  I think that everybody's interessest
  FG> is in working for a small set of standard interface definitions.

What's a sequence then?  If you say anything that PySequence_Check()
says okay for, then there is almost no code that accepts a sequence.
In both cases, we would appear to skip instances that implement the
sequence or mapping protocols, which are accepted most places that
sequences or mappings are accepted.

Jeremy