# How to deal with HoughTransform2DLinesImageFilter GetLines() method in python

**URL:** https://discourse.itk.org/t/how-to-deal-with-houghtransform2dlinesimagefilter-getlines-method-in-python/1861
**Category:** Beginner Questions
**Created:** [May 11, 2019, 2:03pm UTC](https://discourse.itk.org/t/how-to-deal-with-houghtransform2dlinesimagefilter-getlines-method-in-python/1861 "2019-05-11T14:03:23Z")
**Posts on this page:** 1
**Showing post:** 24

<div class="post-metadata">

### Author: ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)
#### Post date: [May 24, 2019, 1:30pm UTC](https://discourse.itk.org/t/how-to-deal-with-houghtransform2dlinesimagefilter-getlines-method-in-python/1861/24 "2019-05-24T13:30:26Z")

</div>

Thanks for your feedback, Francois.

> [@fbudin](#):
>
> Ideally, we would want the C++ code to stay the same, and the wrapping to be modified to return by value, similar to what the two commits/PR that I listed above do.

When the C++ code returns by `const` reference, it _might be_ OK for the Python wrapper to return by value. But when the C++ code returns by non-const reference, I find it counter-intuitive for the Python wrapper to return by value. It would introduce an inconsistency between Python user code and the equivalent C++ user code.

The decision whether or not the Python wrapper should return by value might also depend on the size of the object.

Clearly this is a recurring problem, but I think there is no silver bullet.

---

_[View the full topic](https://discourse.itk.org/t/how-to-deal-with-houghtransform2dlinesimagefilter-getlines-method-in-python/1861)._
