Giter VIP home page Giter VIP logo

Comments (5)

grigi avatar grigi commented on August 21, 2024 1

Thanks for the quick response 👍

from spintax.

AceLewis avatar AceLewis commented on August 21, 2024

When I used literals I did only use raw strings, I only tested the backslashes for a pipe however looking into this I have noticed a different error too.

>>> set([spintax.spin(r"{a\n|b\n|c}") for a in range(1000)])
{'a\\n', 'b\\n', 'c'}

from spintax.

grigi avatar grigi commented on August 21, 2024

I get the data as human input, hence it is an actual newline character instead of a newline representation (as one would get in raw strings).
To my understanding: r'a\n' == 'a\\n' is valid?

from spintax.

AceLewis avatar AceLewis commented on August 21, 2024

No you are correct, I am looking into what I should do in this situation the issue arises because \n is a new line however and the printable characters a\| is actually represented as a\\|

>>> example_1 = 'a\|b'
>>> example_1
'a\\|b'
>>> print(example_1 )
a\|b

>>> example_2 = 'a\nb'
>>> example_2
'a\nb'
>>> print(example_2)
a
b

I am now looking into doing the selection a different way thanks for bringing this to my attention.

from spintax.

AceLewis avatar AceLewis commented on August 21, 2024

I fixed this issue in commit e65c4ba

from spintax.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.