> There's nothing wrong with building dicts or other lookup tables outside
> a function in order to avoid re-creating them every time the function is
> called.
Brilliant! I didn't think of that. I guess I accidentally did it right
this time as I query that dictionary quite a few times from the
fun
On Mon, 11 Jan 2010 18:57:09 +, MRAB wrote:
> There's nothing wrong with building dicts or other lookup tables outside
> a function in order to avoid re-creating them every time the function is
> called.
Actually there is, but the benefit (avoiding the re-creation of the
table) may be worth
On Jan 11, 1:50 pm, Phlip wrote:
> MRAB wrote:
> > Scott wrote:
> >> for prtnmS in open(portfpth):
> >> prtnmS = prtnmS.rstrip()
> > There's nothing wrong with building dicts or other lookup tables outside
> > a function in order to avoid re-creating them every time the function is
> > called.
On Jan 11, 2010, at 2:50 PM, Phlip wrote:
MRAB wrote:
Scott wrote:
for prtnmS in open(portfpth):
prtnmS = prtnmS.rstrip()
There's nothing wrong with building dicts or other lookup tables
outside
a function in order to avoid re-creating them every time the
function is
called.
Ho
MRAB wrote:
Scott wrote:
for prtnmS in open(portfpth):
prtnmS = prtnmS.rstrip()
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
called.
However, please consider writing complete, pronoun
r0g wrote:
> Scott wrote:
>> When creating a function is there any difference between putting
>> everything under the "def" or not?
>>
>> Here I created a function called CscoPortNum to convert the network
>> port number field in a Cisco syslog string from a an ascii name back
>> into its numeric f
Scott wrote:
> When creating a function is there any difference between putting
> everything under the "def" or not?
>
> Here I created a function called CscoPortNum to convert the network
> port number field in a Cisco syslog string from a an ascii name back
> into its numeric form if required. D
Scott wrote:
When creating a function is there any difference between putting
everything under the "def" or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if required. Does it mat