APrioriInvestments / typed_python

An llvm-based framework for generating and calling into high-performance native code from Python.
Apache License 2.0
197 stars 8 forks source link

Accessing attributes of Held Class sometimes raises #421

Closed aaronmlevy closed 1 year ago

aaronmlevy commented 1 year ago

Appears to be okay if we load the instance into a temporary variable, but not if we access attributes on the same line the instance is constructed.

See test_printAttributesShouldWork in date_time_test.py in 9af7203d8fb11862df9fa48aef2339876a270726

braxtonmckee commented 1 year ago

On what branch?

On Mon, Jan 30, 2023 at 11:28 AM aaronmlevy @.***> wrote:

Appears to be okay if we load the instance into a temporary variable, but not if we access attributes on the same line the instance is constructed.

See test_printAttributesShouldWork in date_time_test.py

— Reply to this email directly, view it on GitHub https://github.com/APrioriInvestments/typed_python/issues/421, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6OHBFANN2MLDUAFP24XX3WU7T4TANCNFSM6AAAAAAULLQX2U . You are receiving this because you are subscribed to this thread.Message ID: @.***>

aaronmlevy commented 1 year ago

Branch is aaron_timestamp.

Commit hash is 9af7203d8fb11862df9fa48aef2339876a270726.

aaronmlevy commented 1 year ago

Here's a simple test:

def test_printAttributesShouldWork():
    # This is okay.
    dt = DateTime(2023, 1, 2, 18, 10, 1.0)
    print(dt.date)

    # This is not.
    print(DateTime(2023, 1, 2, 18, 10, 1.0).date)