scrapy / parsel

Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors
BSD 3-Clause "New" or "Revised" License
1.11k stars 137 forks source link

fix: when calling representation of `Selector` on json type #278

Closed Laerte closed 1 year ago

Laerte commented 1 year ago

fix: https://github.com/scrapy/parsel/issues/275#issuecomment-1592763448, remove wrong mention of return string from docstring https://github.com/scrapy/parsel/issues/275#issuecomment-1592800253

codecov[bot] commented 1 year ago

Codecov Report

Merging #278 (c78d638) into master (26ee0c2) will increase coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Current head c78d638 differs from pull request most recent head b6893c0. Consider uploading reports for the commit b6893c0 to get more accurate results

@@            Coverage Diff             @@
##           master     #278      +/-   ##
==========================================
+ Coverage   90.54%   90.57%   +0.02%     
==========================================
  Files           5        5              
  Lines         455      456       +1     
  Branches       93       93              
==========================================
+ Hits          412      413       +1     
  Misses         32       32              
  Partials       11       11              
Impacted Files Coverage Δ
parsel/selector.py 89.50% <100.00%> (+0.03%) :arrow_up:
Gallaecio commented 1 year ago

I think str(s) should return str(s.get()), no shortening, no repr. That’s what repr(s) is for.

Laerte commented 1 year ago

@wRAR

This is due: https://github.com/scrapy/parsel/blob/26ee0c2cc3f3085182756a7ae499d84b5f340684/parsel/selector.py#L879

I pushed the changes accordingly.

Gallaecio commented 1 year ago

Awesome, thanks!