Changeset 963 for trunk


Ignore:
Timestamp:
Jan 5, 2019, 6:59:18 AM (7 months ago)
Author:
cito
Message:

Fix doc error: get/set_cast_hook are connection methods

Location:
trunk/docs/contents/pg
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/contents/pg/connection.rst

    r962 r963  
    321321    it just looks whether or not it knows how to handle such types.
    322322
     323get/set_cast_hook -- fallback typecast function
     324-----------------------------------------------
     325
     326.. method:: Connection.get_cast_hook()
     327
     328    Get the function that handles all external typecasting
     329
     330    :returns: the current external typecast function
     331    :rtype: callable, None
     332    :raises TypeError: too many (any) arguments
     333
     334This returns the callback function used by PyGreSQL to provide plug-in
     335Python typecast functions for the connection.
     336
     337.. versionadded:: 5.0
     338
     339.. method:: Connection.set_cast_hook(func)
     340
     341    Set a function that will handle all external typecasting
     342
     343    :param func: the function to be used as a callback
     344    :rtype: None
     345    :raises TypeError: the specified notice receiver is not callable
     346
     347This methods allows setting a custom fallback function for providing
     348Python typecast functions for the connection to supplement the C
     349extension module.  If you set this function to *None*, then only the typecast
     350functions implemented in the C extension module are enabled.  You normally
     351would not want to change this.  Instead, you can use :func:`get_typecast` and
     352:func:`set_typecast` to add or change the plug-in Python typecast functions.
     353
     354.. versionadded:: 5.0
     355
    323356get/set_notice_receiver -- custom notice receiver
    324357-------------------------------------------------
  • trunk/docs/contents/pg/module.rst

    r960 r963  
    525525    JSON data had been always returned as text strings in earlier versions.
    526526
    527 get/set_cast_hook -- fallback typecast function
    528 -----------------------------------------------
    529 
    530 .. function:: get_cast_hook()
    531 
    532     Get the function that handles all external typecasting
    533 
    534 This returns the callback function used by PyGreSQL to provide plug-in
    535 Python typecast functions.
    536 
    537 .. function:: set_cast_hook(func)
    538 
    539     Set a function that will handle all external typecasting
    540 
    541     :param func: the function to be used as a callback
    542 
    543 If you set this function to *None*, then only the typecast functions
    544 implemented in the C extension module are enabled.  You normally would
    545 not want to change this.  Instead, you can use :func:`get_typecast` and
    546 :func:`set_typecast` to add or change the plug-in Python typecast functions.
    547 
    548 .. versionadded:: 5.0
    549 
    550527get/set_datestyle -- assume a fixed date style
    551528----------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.