Skip to content

(De)compressor context managers potentially incomplete #112

Description

@vtermanis

Hi Jonathan / @jgubmll / @jonathanunderwood, congratulations on frame support & reaching production status!

We provide context manager classes LZ$FrameCompressor and LZ4FrameDecompressor,

Judging by what's on top of master I think you might be missing something there since both __enter__ and __exit__ methods are empty which is a No-Op and basically means the following two do exactly the same thing:

with lz4.frame.LZ4FrameCompressor() as compressor:
   # do stuff with compressor
   pass
# At this point compressor is still in scope so it's no like
# the context has caused it to be GC'ed.

and

compressor = lz4.frame.LZ4FrameCompressor()
# do stuff with compressor

You also mention:

The compression context is created with an appropriate destructor, so no need to del it here

Maybe I'm missing something - where is the appropriate destructor? (I see e.g. no __del__ method.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions