Skip to content

Releases: pwwang/python-varname

0.12.0

05 Oct 19:43
Compare
Choose a tag to compare
  • Support python 3.12
  • Update python3.12 to CI
  • Bump executing to ^2.0
  • Bump up other dependencies
  • Add Dockerfile for codesandbox

Full Changelog: 0.11.2...0.12.0

0.11.2

30 Jun 17:07
Compare
Choose a tag to compare
  • ✨ Add jsobj to create dict without explicitly specifying the key-value pairs

    from varname.helpers import jsobj
    
    a = 1
    b = 2
    # before
    dict(a=a, b=b, c=3)  # {'a': 1, 'b': 2, 'c': 3}
    
    # after
    jsobj(a, b, c=3)  # {'a': 1, 'b': 2, 'c': 3}

Full Changelog: 0.11.1...0.11.2

0.11.1

24 Apr 06:57
Compare
Choose a tag to compare
  • ✨ Support starred variable for varname() (#96)
  • ✅ Fix tests
  • 📝 Update docs for varname(strict=...)

Full Changelog: 0.11.0...0.11.1

0.11.0 (#92)

16 Feb 23:23
362a8a9
Compare
Choose a tag to compare
  • 📝 Update README for shields badges (#91)
  • 🏷️ Overload types for nameof and argname (#77)
  • 💥 Drop python <3.8 for v0.11
    If you need support for python <3.8, please use varname <0.11

0.10.0

26 Sep 19:23
Compare
Choose a tag to compare
  • ✨ Support python 3.11

What's Changed

Full Changelog: 0.9.1...0.10.0

0.9.1 (#87)

19 Sep 18:06
6a9d9d9
Compare
Choose a tag to compare
  • ⬆️ Upgrade executing to 1.0

0.9.0

26 Jul 01:53
25adb71
Compare
Choose a tag to compare
  • ⬆️ Upgrade executing to 0.9

  • 🗑️ Remove deprecated argname2

  • ✨ Support constants for argname even when vars_only=True

  • ✨ Support __getattr__/__setattr__ etc for argname

    Now you can do:

    from varname import argname
    
    class Foo:
        def __getattr__(self, name):
            """Similar for `__getitem__`"""
            print(argname("name"))
    
        def __setattr__(self, name, value):
            """Similar for `__setitem__`"""
            print(argname("name"))
            print(argname("value"))
    
        def __add__(self, other):
            """Similar for `__sub__`, `__mul__`, `__truediv__`, `__floordiv__`,
            `__mod__`, `__pow__`, `__lshift__`, `__rshift__`, `__matmul__`,
            `__and__`, `__xor__`, `__or__`
            """
            print(argname("other"))
    
        def __eq__(self, other):
            """Similar for `__lt__`, `__le__`, `__gt__`, `__ge__`, `__ne__`
            """
            print(argname("other"))
    
    foo = Foo()
    b = 1
    foo.x  # prints: 'x' (note the quotes)
    foo.x = b  # prints: 'x' and b
    foo + b  # prints: b
    foo == b  # prints: b

What's Changed

Full Changelog: 0.8.3...0.9.0

0.8.3 (#74)

18 Mar 00:25
8ec7a86
Compare
Choose a tag to compare

This is more of a housekeeping release:

  • ⬆️ Upgrade executing to 0.8.3 to make varname work with ipython 8+
  • 📝 Update README.md to add new contributors
  • 🚨 Use flake8 instead of pylint for linting

0.8.2 (#72)

07 Mar 04:22
47f2852
Compare
Choose a tag to compare

Fixes

  • 🩹 Use sysconfig instead of distutils.sysconfig to avoid deprecatewarning for python 3.10+ (#71)

Housekeeping

  • 👷 Add python3.10 in CI
  • 📄 Add license back

0.8.1 (#65)

30 Aug 19:34
b9bdf22
Compare
Choose a tag to compare
  • Handle inspect raises "could not get source code" when printing rich exception message