Hi,
I just found a neat trick to free up an emergency stash of memory in a funtion
that overrides sys.excepthook. The rationale is that all exceptions, including
MemoryErrors will be logged.
The code is below. My question: is that memory *guaranteed* to be freed right
after the 'del'
On Sun, Jan 10, 2016 at 11:53:22AM +, Albert-Jan Roskam wrote:
> Hi,
>
> I just found a neat trick to free up an emergency stash of memory in a
> funtion that overrides sys.excepthook.
> rainydayfund = [[] for x in xrange(16*1024)] # or however much you need
> def handle_exception(e):
>
[Albert-Jan Roskam ]
> I just found a neat trick to free up an emergency stash of memory in
> a funtion that overrides sys.excepthook. The rationale is that all
> exceptions, including MemoryErrors will be logged.
> The code is below. My question: is that memory
Albert-Jan Roskam wrote:
> Hi,
>
> I just found a neat trick to free up an emergency stash of memory in a
> funtion that overrides sys.excepthook. The rationale is that all
> exceptions, including MemoryErrors will be logged. The code is below. My
> question: is that memory *guaranteed* to be
Lawrence Lorenzo wrote:
> import randomimport timeimport math
> #the player and NPC class.class char(object): #character attributesdef
> #__init__(self, name, health, attack, rng, magic, speed):self.name
> #= nameself.health = healthself.attack = attack
>
On 10/01/16 15:21, Lawrence Lorenzo wrote:
Please use plain text to send mail. Your formatting
makes the code unreadable.
Thankfully the error does all the work for us...
> import randomimport timeimport math
> #the player and NPC class.class char(object): #character attributesdef
>
import randomimport timeimport math
#the player and NPC class.class char(object): #character attributesdef
__init__(self, name, health, attack, rng, magic, speed):self.name =
nameself.health = healthself.attack = attackself.speed
= rngself.magic =