[–] 14 points 6 months ago (2 children)

Didn’t think I’d learn anything new in this article, but I never knew about f-string’s self-documenting expression syntax. I’ve been doing it myself like a chump!

  • source
  • [–] 1 point 6 months ago

    Like where you were going with ordering tea.

    For seasoning recommend, nutmeg and cinnamon. And just assume it smells nice. Without the ritual rolling a $ bill and snorting it.

    For variety, can also add turmeric and powder pepper. The combination is supposed to be good for health, but guaranteed to blow the mind of your neighbors. Who are not used to putting pepper in tea.

  • source
  • parent
  • context
  • [–] 1 point 6 months ago* (last edited 6 months ago)

    tl;dr

    • cooldown

    Give security researchers time to detect supply chain attacks, by delaying installing a package's latest release by n days. Where n is delay before security researchers are able to acknowledge sarcasm (aka some arbitrary number).

    $> pip install --uploaded-prior-to=P3D pip --force-reinstall # exclude the recent pip release

    Where 3D is delay by 3 days. From the context, guess P means prior, not pussy, pizza, nor pedocrat. Actually your guess is as good as mine. I'm confused what P is supposed to mean, especially given the state of the dating scene.

    • lock file support

    some foreplay and teasing

  • source
  • [–] 4 points 6 months ago

    [The action] was set up in a way where text from a PR comment could be passed directly into a shell command, so whatever the comment said, the runner would execute it.

    Oh, lol

  • source
  • [–] 1 point 6 months ago (1 child)

    yes, you're creating a derivative work that is entirely GPL. note that this doesn't stop anyone from consulting the original since FOSS licenses do not have revocation. if they use none of the GPL derivative work they can still only abide by MIT. however, your changes would only exist in the GPL work, and they must be used with GPL.

  • source
  • parent
  • context
  • [–] 1 point 6 months ago (3 children)

    The MIT is what's called a permissive license.

    Copyright

    Permission is hereby granted , free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense , and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    That's the entirety of the text. You can do pretty much anything as long as you make sure the first line is still visible somewhere (and if you're not incorporating/relicensing it into GPL, you have to include the MIT license text as well; I'm less sure about how this parenthetical works but I do know an MIT project relicensed to GPL needs not include the MIT text), which in GPL it is.

    https://choosealicense.com/licenses/mit/

    https://www.gnu.org/licenses/license-list.html#:~:text=Expat)-,This%20is%20a%20lax%2C%20permissive%20non%2Dcopyleft%20free%20software%20license%2C%20compatible%20with%20the%20GNU%20GPL.,-Some

  • source
  • parent
  • context
  • [–] 1 point 7 months ago* (last edited 7 months ago)

    There are tools to check README files. Which would give suggestions on what needs to be fixed.

    If you are using Sphinx anyway, would suggest going with a ReStructuredText rather than vanilla markdown.

    In your Sphinx docs, can mix rst and md but the index file must be index.rst, not index.md

    Then use this sphinx-external-toc-strict for structuring your Sphinx docs.

    restview for real time editing of restructuredtext file

  • source
  • [–] 4 points 7 months ago*

    Using id() as a key in dict() may get you into trouble.

    IMO, using id() as a key would never be a good idea under any circumstance.

    Two different (and even unequal) objects can have the same id():

    >>> x = [1]
    >>> id(x)
    4527263424
    >>> del x
    >>> x = [2]
    >>> id(x)
    4527263424
    >>> del x
    >>> y = [3]
    >>> id(y)
    4527263424
    

    Note - a dictionary lookup already looks up the key by id() first as a shortcut (under-the-hood), so there's no need to try doing this as an optimization.

    Edit: in case it wasn't clear above, the object with the same id()s don't all exist at the same time; but if you store their ids as a key, you'd have to ensure the object lifetimes are identical to be sure the ids could identify the same stored value. The dictionary does this for you when you use the key object, but it's not automatic when using the id of the key.

    Other Note - Since you phrased it as "all ints below a fixed limit share the same id() result", I'd suggest a better way to semantically think of it is that certain constant objects are pre-allocated, and thus are kinda like singletons. There is usually only one int(1) object, and the language keeps a pre-allocated pool of these common small ints (since they are used so often for indexing anyway).

    Similarly, many short string constants are 'interned' in a similar way; they aren't pre-created at startup, but once they are created by the user declaring a string constant when the code is run, it saves memory to check and only keep one copy of those string objects, as the string constants can be checked at byte-compile time. But if you construct the string with code, it doesn't bother to check all the strings to see if there exists an identical one. So for example:

    >>> x = 'ab'
    >>> y = 'ab'
    >>> id(x) == id(y)
    True
    >>> s = 'a'
    >>> s = s + 'b'
    >>> id(s) == id(x)
    False
    >>> s == x == y
    True
    

    But you can force it to make this check; it's something they made more tedious to do in Python3 since it's really an implementation detail:

    >>> import sys
    >>> s = sys.intern(s)
    >>> id(s) == id(x)
    True
    

    Sorry for the verbose reply; hope it helped.

  • source
  • parent
  • context
  • view more: ‹ prev next ›