A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/091050.html below:

Python + Borland - msvcrt = grr.

Python + Borland - msvcrt = grr.Neil Hodgson nhodgson at bigpond.net.au
Mon Apr 23 20:01:13 EDT 2001
Stephen Hansen:

>  PyObject* retval = NULL;
>         if (!PyArg_ParseTuple(args, ":buffer_info"))
>                 return NULL;
>  retval = PyTuple_New(2);

   This is a case where I feel that the code is better written as-is rather
than rewriting it to avoid the BCC warning as it is more likely to continue
to achieve consistent results after editing. Its better to initialise all
variables upon declaration as the code can not then rely on uninitialised
values which lead to random behaviour. Reproducibility should be a goal as
unreproducible errors are a great way of wasting huge amounts of debug time.

   If this was C++ rather than C, then it would be even better to move the
declaration and initialisation to the first assignment as this decreases the
scope of retval making it less likely to be abused.

   If there are a lot of these warnings, then the appropriate pragma can be
used:
#ifdef __BORLANDC__
// Borland warns that values are assigned but never used.
// This is OK in this code so turn off the warning.
#pragma warn -aus
#endif

   Neil




More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4