deshipu,
@deshipu@fosstodon.org avatar

deleted_by_author

  • Loading...
    orsinium,
    @orsinium@fosstodon.org avatar

    @deshipu "Flat is better than nested" 😉 Besides, maybe I misunderstand you, but all typing-related stuff is already in a separate namespace: the "typing" module (and "collections.abc").

    deshipu,
    @deshipu@fosstodon.org avatar

    deleted_by_author

  • Loading...
  • docRekd,

    @deshipu @orsinium

    You can do 'import typing as t' to put it in a separate namespace

    deshipu,
    @deshipu@fosstodon.org avatar

    deleted_by_author

  • Loading...
  • docRekd,

    @deshipu @orsinium So your problem is that, unlike some other programming languages like where you can have an object with the same name as a (and in fact Scala has some extra rules for implicits resolutions for companion objects), types are essentially objects.
    I think that is a feature, not a bug, as it allows to have

    deshipu,
    @deshipu@fosstodon.org avatar

    deleted_by_author

  • Loading...
  • docRekd,

    @deshipu @orsinium
    So the thing you're objecting is that they're run time objects.

    There is advantage to that tradeoff: unlike with erased types like in can introspect its types and do all kind of interesting things like allowing https://docs.python.org/3/library/dataclasses.html to introspect they type of its fields and check them

    deshipu,
    @deshipu@fosstodon.org avatar

    deleted_by_author

  • Loading...
  • docRekd,

    @deshipu @orsinium Python doesn't have macros yet

    https://peps.python.org/pep-0638/

    deshipu,
    @deshipu@fosstodon.org avatar

    deleted_by_author

  • Loading...
  • docRekd,

    @deshipu @orsinium Listen without neither type introspection nor macros how do you implement https://docs.python.org/3/library/dataclasses.html ?

    deshipu,
    @deshipu@fosstodon.org avatar

    deleted_by_author

  • Loading...
  • docRekd,

    @deshipu @orsinium

    Ok man you might not want it but plenty of people want a simple "bag of dumb fields" syntax

    Stop assuming that just because you might not want or need neither everyone else do

    deshipu,
    @deshipu@fosstodon.org avatar

    deleted_by_author

  • Loading...
  • docRekd,

    @deshipu @orsinium
    Also dataclasses are not the only thing that consumes types at runtime and having a separate PEP for all of those would be unviable

    docRekd,

    @deshipu
    Again don't assume everyone else shares your own engineering values

    docRekd,

    @deshipu @orsinium
    Not really, dependent typing is all about making types first class citizens

  • All
  • Subscribed
  • Moderated
  • Favorites
  • python
  • DreamBathrooms
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • JUstTest
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • megavids
  • lostlight
  • All magazines