MS Windows Clipboard

Steve Holden sholden at holdenweb.com
Thu Oct 26 21:39:14 EDT 2000


Mark Hammond wrote:
> 
> "Alex Martelli" <aleaxit at yahoo.com> wrote in message
> news:8ta16b01n0d at news2.newsguy.com...
> > "Mark Hammond" <MarkH at ActiveState.com> wrote in message
> 
> We are discussing a new optional param for the Win32 clipboard
> functions that would specify the type of the returned data.
> 
> I proposed a simple string:
> > > What would this param look like - maybe a simple string
> > > "string", "unicode", "handle", with None or "" == default?
> 
> Alex suggested a type object:
> > Or maybe type(""), type(u""), type(PyHandle)...?
> 
> Your idea sounds more "correct", but also more verbose and less
> "handy"
> 
> OTOH, using the types module makes it better:
> 
>   GetClipboardText(..., types.UnicodeType)
> 
> I would probably use types.IntType for a handle, as we may not be able
> to provide automatic handle cleanup.  I'm afraid I can't recall the
> exact semantics, and haven't the time to look.
> 
> Any votes on this?  Should we go for:
> 
>   GetClipboardText(..., types.UnicodeType)
> or
>   GetClipboardText(..., "unicode")
> 
> ?
> 
> Mark.

The former seems cleaner.  It would also be quicker, though I'm not
usually one to obsess about a few wasted machine cycles.

When I use Tkinter I always shudder to think about all the data that's
being passed as strings when enumerated constants or simple integers
would be better.

Some-things-are-worth-not-inheriting-from-your-predecessor-ly y'rs - steve
-- 
Helping people meet their information needs with training and technology.
703 967 0887      sholden at bellatlantic.net      http://www.holdenweb.com/





More information about the Python-list mailing list