HHousen / TransformerSum

Unnecessary delete statement in a local scope PTC-W0043
Anti-pattern
Major
3 years ago3 years old
Unnecessary del statement in a local scope
428    sents = (
429        [[token.text for token in sentence] for sentence in doc] for doc in doc_sents
430    )
431    del doc_sents432
433    logger.debug("Done in %.2f seconds", time() - t0)
434    # `sents` is an array of documents where each document is an array sentences where each
Unnecessary del statement in a local scope
267        split_output_path = os.path.join(args.base_output_path, (name + ".json"))
268    save(dataset, split_output_path, compression=args.compression)
269
270    del dataset271    gc.collect()
272
273
Unnecessary del statement in a local scope
254    pool.join()
255    del source_docs_tokenized
256    del target_docs
257    del target_docs_tokenized258    gc.collect()
259
260    logger.info("Done in %.2f seconds", time() - t0)
Unnecessary del statement in a local scope
253    pool.close()
254    pool.join()
255    del source_docs_tokenized
256    del target_docs257    del target_docs_tokenized
258    gc.collect()
259
Unnecessary del statement in a local scope
252
253    pool.close()
254    pool.join()
255    del source_docs_tokenized256    del target_docs
257    del target_docs_tokenized
258    gc.collect()