Ticket #58 (closed enhancement: fixed)

Opened 3 months ago

Last modified 2 months ago

Compiler directive "nonecheck"

Reported by: dagss Assigned to: dagss
Priority: minor Milestone: 0.10
Component: Code Generation Version:
Keywords: segfault directive None niceness Cc:

Description

A compiler directive which will inserts checks for None in these situations:

cdef MyClass x = None
print x.a # AttributeNode
print x[0] # IndexNode

The exception raised is proposed to match Python:

AttributeError: 'NoneType' object has no attribute 'a'
TypeError: 'NoneType' object is unsubscriptable

This will default to off (until there's good flow control in place, and then perhaps switch the default to on? But that belongs another place).

Change History

08/22/2008 02:44:03 AM changed by dagss

  • keywords changed from segfault directive to segfault directive None.

08/22/2008 05:32:14 AM changed by dagss

  • type changed from defect to enhancement.

08/26/2008 05:29:12 AM changed by dagss

  • keywords changed from segfault directive None to segfault directive None niceness.

09/18/2008 02:18:39 AM changed by dagss

  • owner changed from somebody to dagss.

I am nearly done with this.

09/18/2008 02:18:49 AM changed by dagss

  • status changed from new to assigned.

09/18/2008 02:56:37 AM changed by dagss

  • milestone changed from wishlist to 0.9.8.2.

09/22/2008 01:42:06 PM changed by dagss

Done in http://hg.cython.org/cython-devel/rev/9b3c50885a54

I just need to add testcases for buffer access and then I'll close it.

09/25/2008 09:39:26 AM changed by anonymous

  • status changed from assigned to closed.
  • resolution set to fixed.

http://hg.cython.org/cython-devel/rev/06bcb482828a

Rather, an implementation was needed :-)