Skip to content

Conversation

@blubberdiblub
Copy link

I was hoping to use the convenience functions with the same parameters as is possible when directly instantiating TextLorem() objects, but I was surprised this doesn't work.

i.e. this doesn't work:

import lorem
lorem.text(trange=(2, 2))

whereas this does:

from lorem.text import TextLorem
TextLorem(trange=(2, 2)).text()

However, this looks like a mistake rather than intention, as the delegation of the parameters is already present in __init__.py, only the parameters are handed over to the methods of the TextLorem class, which don't take arguments.

My changes make the former work as well, which is more convenient and very slightly easier to read for one-time usage.

The convenience functions now delegate the parameters they're called
with to the temporary instantiation of the `TextLorem` class instead of
the method calls, the latter of which don't have arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant