Ycecream

Latest version: v1.3.20.post0

Safety actively analyzes 710445 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 7

1.3.9

=========================
New functionality (0)
---------------------
A new parameter 'provided' is added to the call y.
If provided is True, output will be generated as usual, but if provided is False,
all output will be suppressed as with enabled=False.
This is useful when output is only wanted if some condition is met, e.g.
x = 12
temperature = 18
y(x, provided=temperature>25)
In this case, nothing will be printed.

New functionality (1)
---------------------
Introduced the method assert_. If the assert_ is called with a Falsy value, an AssertionError will be raised.
The biggest difference with the assert statement is, that this enabling/disabling can be controlled in the program.
E.g.
x = 12
temperature = 18
y.assert_(temperature>25)
This will result in an AssertionError.
but
E.g.
y.enabled = False
x = 12
temperature = 18
y.assert_(temperature>25)
won't raise an error

Changed functionality (0)
-------------------------
If enabled is False, calling y with as_str will now return the null string.

Changed functionality (1)
-------------------------
The attributes decorator (d) and context_manager (cm) can now only be used in a call to y.
So, they can no longer be part of the configuration .json file, nor are they parameters for new, fork or clone.
This change is made to make sure that decorator (d) and context_manager (dm) can only be applied to the call.

1.3.8

=========================
New functionality (0)
---------------------
Introduced a new attribute "value_only_for_fstrings" (shorthand "voff").
By default, Values_only_for_fstrings is False.
When values_only_for_fstring is True, the f-string itself will not be shown.
Example:
x = 12.3
y(f"{x:0.3e}")
y.values_only_for_fstrings = True
y(f"{x:0.3e}")
prints
y| f"{x:0.3e}": '1.230e+01'
y| '1.230e+01'
Note that, when the test script is run on Python < 3.6, the corresponding test is skipped.

Bugfix (0)
----------
The shortcut st was defined twice, resulting in being a shortcut for show_traceback only.
From now on st is a shortcut for show_time and stb is a shortcut for show_traceback.

Example:
y.show_time = True
y(y.st)
y.show_time = False
y(y.st)
y.show_traceback = True
y(y.stb)
y.show_traceback = False
y(y.stb)
prints something like:
y| 14:47:46.356834 ==> y.st: True
y| y.st: False
y| y.stb: True
Traceback (most recent call last)
File "c:\Users\Ruud\Dropbox (Personal)\Apps\Python Ruud\ycecream\x.py", line 8, in <module>
y(y.stb)
y| y.stb: False

More compact output for multiple lines, when the context fits within the wrap_indent on the first line, like
a = 12
b = 4
y.separator = ""
y(a,b)
y.prefix = "prefix| "
y(a,b)
prints
y| a: 12
b: 4
prefix|
a: 12
b: 4

1.3.7

=========================
Changed functionality (0)
-------------------------
More compact output for multiple lines, when the context fits within the wrap_indent on the first line, like
a = 12
b = 4
y.separator = ""
y(a,b)
y.prefix = "prefix| "
y(a,b)
prints
y| a: 12
b: 4
prefix|
a: 12
b: 4

Changed functionality (1)
-------------------------
The yc ycecream object has now "yc| " as prefix and is now different from y. E.g.
from ycecream y, yc
a=1
y(a)
yc(a)
prints
y| a: 12
yc| a: 12
Note that yc is forked from y, so if you change an attribute of y (and that attribute is not
explicitely set in yc)), that attribute is also changed in yc, e.g.
from ycecream y, yc
y.enabled = False
yc(1)
y.enabled = True
yc(2)
prints
yc| 2
and not yc| 1 , as y.enabled propagates to yc.enabled

1.3.6

=========================
Changed functionality (0)
-------------------------
The attribute pair_delimiter is now called separator (shorthand sep).

If separator is blank, multiple items will be automatically placed on multiple lines. E.g.
from ycecream import y
a = 12
b = 4 * ["test"]
y(a, b)
y(a, b, sep="")
prints
y| a: 12, b: ['test', 'test', 'test', 'test']
y|
a: 12
b: ['test', 'test', 'test', 'test']


Changed functionality (1)
-------------------------
The attribute context_delimiter is now called context_separator (shorthand cs).


New functionality (0)
---------------------
Introduced a new attribute: equals_separator (shorthand es).
This string is used to separate the name of a variable of expression and the value (by deafult it is ": ").
Example:
from ycecream import y
a = 12
b = 4 * ["test"]
y(a, b)
y(a, b, equals_separator=" => ")
prints
y| a: 12, b: ['test', 'test', 'test', 'test']
y| a => 12, b => ['test', 'test', 'test', 'test']


New functionality (1)
---------------------
Ycecream now also has a yc variable that is equal to y. So it is possible to use
from ycecream import yc
Please note that after
from ycecream import y
from ycecream import yc
y and yc refer to the same object!

1.3.5

=========================
New functionality (0)
---------------------
The attribute delta can now be used as an ordinary attribute,
including propagation and initialization from json.

New tests (0)
-------------
Tests for propagation of attributes added.
Tests for delta setting/reading added.

Bugfix (0)
----------
The recently introduced show_traceback facility didn't work under Python 2.7. Fixed.

1.3.4

=========================
New functionality (0)
---------------------
Introduced a new attribute: show_traceback / st .

When show_traceback is True, the ordinary output of y() will be followed by a printout of the
traceback, similar to an error traceback.

from ycecream import y
y.show_traceback=True
def x():
y()

x()
x()
prints
y| 4 in x()
Traceback (most recent call last)
File "c:\Users\Ruud\Dropbox (Personal)\Apps\Python Ruud\ycecream\x.py", line 6, in <module>
x()
File "c:\Users\Ruud\Dropbox (Personal)\Apps\Python Ruud\ycecream\x.py", line 4, in x
y()
y| 4 in x()
Traceback (most recent call last)
File "c:\Users\Ruud\Dropbox (Personal)\Apps\Python Ruud\ycecream\x.py", line 7, in <module>
x()
File "c:\Users\Ruud\Dropbox (Personal)\Apps\Python Ruud\ycecream\x.py", line 4, in x
y()

The show_traceback functionality is also available when y is used as a decorator or context manager.

Page 3 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.